Skip to content

Instantly share code, notes, and snippets.

@weissi
Created February 23, 2015 20:34
Show Gist options
  • Save weissi/964b4069a671a4ffc6c4 to your computer and use it in GitHub Desktop.
Save weissi/964b4069a671a4ffc6c4 to your computer and use it in GitHub Desktop.
demoes short circuiting
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