Skip to content

Instantly share code, notes, and snippets.

@sprengerjo
Created June 24, 2013 19:59
Show Gist options
  • Save sprengerjo/5853059 to your computer and use it in GitHub Desktop.
Save sprengerjo/5853059 to your computer and use it in GitHub Desktop.
fluent functional
// pretty cool way of saying: sum ‘+’ all values stored in ‘scores’, a is the result of the previous iteration,
// b is the current value.
[ scores.reduce[a, b | a + b ]]
// You can also do something like this:
scores.forEach[value, index | println(value + "@" + index)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment