Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.15 KB | None | 0 0
  1. #!/usr/bin/ruby
  2. def wtf()
  3.   x = 1
  4.   inc_x = lambda { x += 1 }
  5.   inc_x.call()
  6.   x
  7. end
  8. puts "Hello world: " + wtf().to_s
  9. # Result is:
  10. # Hello world: 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement