Skip to content

Instantly share code, notes, and snippets.

@burke
Created January 28, 2010 16:08
Show Gist options
  • Save burke/288867 to your computer and use it in GitHub Desktop.
Save burke/288867 to your computer and use it in GitHub Desktop.
irb(main):008:0> block = Proc.new{print "Hello"}
=> #<Proc:0x00000001016f45f8@(irb):8>
irb(main):009:0> new_block = Proc.new{|block| block.call; print ", World!"}
=> #<Proc:0x00000001016e6750@(irb):9>
irb(main):010:0> new_block.call(block)
Hello, World!=> nil
irb(main):011:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment