daily pastebin goal
67%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @goto = {}
  2.  
  3. def label(name)
  4.   callcc{|c| @goto[name] = c }
  5. end
  6.  
  7. def goto(name)
  8.   @goto.fetch(name).call
  9. end
  10.  
  11. a = 1
  12. b = 2
  13.  
  14. label :add
  15. a += 1
  16. b += 1
  17. goto :add unless a > 10
  18. p a
  19. p b
RAW Paste Data
Top