Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Add Comment
Please, Sign In to add comment