Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@avit
Created January 28, 2016 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avit/6be91ba2f35d8871c4b9 to your computer and use it in GitHub Desktop.
Save avit/6be91ba2f35d8871c4b9 to your computer and use it in GitHub Desktop.
I hate this about ruby
lm = lambda { |things, *options| puts things.inspect, options.inspect }
pr = proc { |things, *options| puts things.inspect, options.inspect }
lm.call([1,2], 'a') #=> [1, 2], ["a"]
pr.call([1,2], 'a') #=> [1, 2], ["a"]
lm.call([1,2]) #=> [1, 2], []
pr.call([1,2]) #=> 1, [2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment