Advertisement
Guest User

match

a guest
Sep 19th, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.14 KB | None | 0 0
  1. val x : Option[Int] = None
  2.  
  3. x match {
  4.   case None =>
  5.     //do none stuff
  6.   case Some(y) =>
  7.     // do some stuff, and you can use y:Int here
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement