Created
October 15, 2010 11:37
-
-
Save adilsoncarvalho/628048 to your computer and use it in GitHub Desktop.
How to write lambdas in boo
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
# | |
# Thanks to Glauco Vinicius who teached this to me | |
# | |
# | |
# our little lambda that evaluates if a number is even or odd | |
# | |
IsEven = { x | (x % 2) == 0 } | |
# | |
# the tests | |
# | |
assert IsEven(4) | |
assert not IsEven(7) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment