Created
February 23, 2015 20:34
-
-
Save weissi/964b4069a671a4ffc6c4 to your computer and use it in GitHub Desktop.
demoes short circuiting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let acts : [() -> Bool] = [ { () in println("foo"); return true; }, { () in println("bar"); return true; }] | |
acts.reduce(false, combine:{ $0 || $1() }) | |
println("DONE") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment