Skip to content

Instantly share code, notes, and snippets.

@adilsoncarvalho
Created October 15, 2010 11:37
Show Gist options
  • Save adilsoncarvalho/628048 to your computer and use it in GitHub Desktop.
Save adilsoncarvalho/628048 to your computer and use it in GitHub Desktop.
How to write lambdas in boo
#
# 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