Skip to content

Instantly share code, notes, and snippets.

@thatrubylove
Created April 30, 2014 04:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thatrubylove/744e8e3a59d5ab5f1fc6 to your computer and use it in GitHub Desktop.
Save thatrubylove/744e8e3a59d5ab5f1fc6 to your computer and use it in GitHub Desktop.
LISPy code as data in ruby
# treating a function as data
putter = ->(message) { puts message }
def deliver_message(message, handler)
handler.(message)
end
deliver_message("Hello, code as data!", putter)
# => Hello, code as data!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment