Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/ruby
- def wtf()
- x = 1
- inc_x = lambda { x += 1 }
- inc_x.call()
- x
- end
- puts "Hello world: " + wtf().to_s
- # Result is:
- # Hello world: 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement