about summary refs log tree commit diff
path: root/src/rt/rust_kernel.cpp
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2012-03-26 16:09:27 +0200
committerMarijn Haverbeke <marijnh@gmail.com>2012-03-27 09:27:31 +0200
commitf6e3738b9c824e56f561e75f0ff11cf3a0d2dd09 (patch)
treeab6624224bc83dc5edc4561b6d3d81860ecf6cef /src/rt/rust_kernel.cpp
parent9638e7fece158fd084a1d1f70970d716e9979f96 (diff)
downloadrust-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