Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created February 17, 2012 01:53
Show Gist options
  • Select an option

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

Select an option

Save practicingruby/1849750 to your computer and use it in GitHub Desktop.
>> def foo
>> yield(1)
>> end
=> nil
>> foo { }
=> nil
>> bar = ->() { }
=> #<Proc:0x00000100a70f98@(irb):5 (lambda)>
>> foo(&bar)
ArgumentError: wrong number of arguments (1 for 0)
from (irb):5:in `block in irb_binding'
from (irb):2:in `foo'
from (irb):6
from /Users/seacreature/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment