/test/pending/closed_upval.rb
http://github.com/feyeleanor/RubyGoLightly · Ruby · 11 lines · 7 code · 2 blank · 2 comment · 0 complexity · 20edf63a6d241aac8fdf9cfddd2cc790 MD5 · raw file
- def add(x)
- Proc.new do |y|
- x + y
- end
- end
- puts add(2).call(3)
- # => 5
- puts add(3).call(5)
- # => 8