Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.40 KB | None | 0 0
  1. scala> def x(f: => Any) = try { f } catch { case _ => println("YES") }
  2. x: (f: => Any)Any
  3.  
  4. scala> x { throw new Exception }                                      
  5. YES
  6. res3: Any = ()
  7.  
  8. scala> x { actor { throw new Exception} }                            
  9. res4: Any = scala.actors.Actor$$anon$1@1aaf194
  10.  
  11. scala> scala.actors.Actor$$anon$1@1aaf194: caught java.lang.Exception
  12. java.lang.Exception
  13. .
  14. .
  15. .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement