Created
June 24, 2013 19:59
-
-
Save sprengerjo/5853059 to your computer and use it in GitHub Desktop.
fluent functional
This file contains 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
// 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