diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2012-03-26 16:09:27 +0200 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2012-03-27 09:27:31 +0200 |
| commit | f6e3738b9c824e56f561e75f0ff11cf3a0d2dd09 (patch) | |
| tree | ab6624224bc83dc5edc4561b6d3d81860ecf6cef /src/rt/rust_kernel.cpp | |
| parent | 9638e7fece158fd084a1d1f70970d716e9979f96 (diff) | |
| download | rust-f6e3738b9c824e56f561e75f0ff11cf3a0d2dd09.tar.gz rust-f6e3738b9c824e56f561e75f0ff11cf3a0d2dd09.zip | |
Support an alternate for syntax that calls a higher-order function
The last argument of the call must be a block, and the type of this
argument must a function returning bool. `break` and `cont` are
supported in the body of the block, and return `false` or `true` from
the function. When the end of the function is reached, `true` is
implicitly returned.
for vec::all([1, 2, 3]) {|elt|
if elt == 2 { break; }
log(error, elt);
}
Issue #1619
Diffstat (limited to 'src/rt/rust_kernel.cpp')
0 files changed, 0 insertions, 0 deletions
