Skip to content

Instantly share code, notes, and snippets.

@tj
Created August 3, 2013 19:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tj/6147699 to your computer and use it in GitHub Desktop.
Save tj/6147699 to your computer and use it in GitHub Desktop.
Luna
tobi = { name = 'tobi' }
loki = { name = 'loki' }
# equality
same = |a, b| a.name == b.name
print(same(tobi, loki))
# greeting
greet = |user| 'Hello ' .. user.name
print(greet(tobi))
# greeting curried
greet = |msg| |user| msg .. user.name
greeter = greet('Hello ')
print(greeter(tobi))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment