Skip to content

Instantly share code, notes, and snippets.

@myronmarston
Created July 8, 2010 20:45
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 myronmarston/468597 to your computer and use it in GitHub Desktop.
Save myronmarston/468597 to your computer and use it in GitHub Desktop.
ruby-1.8.7-p299 ➜ ~ irb
ruby-1.8.7-p299 > k = (1..3).map { |x| lambda { x } }
=> [#<Proc:0x0000000100454f10@(irb):1>, #<Proc:0x0000000100454f10@(irb):1>, #<Proc:0x0000000100454f10@(irb):1>]
ruby-1.8.7-p299 > k[0].call
=> 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment