Skip to content

Instantly share code, notes, and snippets.

@jackdempsey
Created November 7, 2008 20:52
Show Gist options
  • Select an option

  • Save jackdempsey/22962 to your computer and use it in GitHub Desktop.

Select an option

Save jackdempsey/22962 to your computer and use it in GitHub Desktop.
~ $ irb
>> a = lambda { |b| puts "hello"; s = b.call; puts 'goodbye'; s }
=> #<Proc:0x02263da4@(irb):5>
>> b = lambda { puts 'middle' }
=> #<Proc:0x0226c7b0@(irb):2>
>> a.call(b)
hello
middle
goodbye
=> nil
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment