Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created November 20, 2012 05:49
Show Gist options
  • Select an option

  • Save practicingruby/4116274 to your computer and use it in GitHub Desktop.

Select an option

Save practicingruby/4116274 to your computer and use it in GitHub Desktop.
## 1.9.3
>> RUBY_VERSION
=> "1.9.3"
>> Proc.new { |a,b| [a,b] }.call
=> [nil, nil]
>> proc { |a,b| [a,b] }.call
=> [nil, nil]
>> lambda { |a,b| [a,b] }.call
ArgumentError: wrong number of arguments (0 for 2)
from (irb):4:in `block in irb_binding'
from (irb):4:in `call'
from (irb):4
from /Users/seacreature/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `<main>'
## 1.8.7
>> RUBY_VERSION
=> "1.8.7"
>> Proc.new { |a,b| [a,b] }.call
=> [nil, nil]
>> proc { |a,b| [a,b] }.call
ArgumentError: wrong number of arguments (0 for 2)
from (irb):3
from (irb):3:in `call'
from (irb):3
>> lambda { |a,b| [a,b] }.call
ArgumentError: wrong number of arguments (0 for 2)
from (irb):4
from (irb):4:i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment