1 class Rescueable[A](a: => A) { 2 def rescue[B](b: => B) = try{a}catch{case _ => b} 3 } 4 5 implicit def anyToRescueable[A](a: => A) = new Rescueable(a) 6 7 println("12341234".toLong rescue 0) // => 12341234 8 println("1234x1234".toLong rescue 0) // => 0