Skip to content

Instantly share code, notes, and snippets.

@fdelacruz
Created August 7, 2014 01:15
Show Gist options
  • Select an option

  • Save fdelacruz/2159133e36d240f62941 to your computer and use it in GitHub Desktop.

Select an option

Save fdelacruz/2159133e36d240f62941 to your computer and use it in GitHub Desktop.
lam = lambda { |x| puts x } # creates a lambda that takes 1 argument
lam.call(2) # prints out 2
lam.call # ArgumentError: wrong number of arguments (0 for 1)
lam.call(1,2,3) # ArgumentError: wrong number of arguments (3 for 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment