Skip to content

Instantly share code, notes, and snippets.

@igrigorik
Created August 15, 2011 00:02
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 igrigorik/1145480 to your computer and use it in GitHub Desktop.
Save igrigorik/1145480 to your computer and use it in GitHub Desktop.
igrigorik { /git/goliath/examples } > cat test.rb
blk = Proc.new {|a,*b| p [:block_args, a,b] }
blk.call(1,2,3)
blk.call([1,2,3])
igrigorik { /git/goliath/examples } > ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0]
igrigorik { /git/goliath/examples } > ruby test.rb
[:block_args, 1, [2, 3]]
[:block_args, 1, [2, 3]]
igrigorik { /git/goliath/examples } > rvm use jruby
Using /Users/igrigorik/.rvm/gems/jruby-1.6.2
igrigorik { /git/goliath/examples } > jruby --1.9 test.rb
[:block_args, 1, [2, 3]]
[:block_args, [1, 2, 3], []] <<<<<<<<<<<<<<<<<<<<<<< Hmmm?
igrigorik { /git/goliath/examples } > jruby test.rb
[:block_args, 1, [2, 3]]
[:block_args, 1, [2, 3]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment