Guest User

Untitled

a guest
Jun 20th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.35 KB | None | 0 0
  1. import scala.util.continuations._
  2.  
  3. def test1 = reset {
  4.   print("1")
  5. }
  6.  
  7. > wypisze 1
  8.  
  9. def test2 = reset {
  10.   print("1")
  11.   shift { cont: (Unit => Unit) =>
  12.     print("2")
  13.   }
  14.   print("3")
  15. }
  16.  
  17. > wypisze 12
  18.  
  19.  
  20. def test3 = reset {
  21.   print("1")
  22.   shift { cont: (Unit => Unit) =>
  23.     print("2")
  24.     cont()
  25.   }
  26.   print("3")
  27. }
  28.  
  29. > wypisze 132
Add Comment
Please, Sign In to add comment