Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created February 11, 2015 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shigemk2/11ecc789f1e269ea0ada to your computer and use it in GitHub Desktop.
Save shigemk2/11ecc789f1e269ea0ada to your computer and use it in GitHub Desktop.
val i = 5
i match {
case a if 0 to 9 contains a => println("0-9 range: " + a)
case b if 10 to 19 contains b => println("10-19 range: " + b)
case c if 20 to 29 contains c => println("20-29 range: " + c)
case _ => println("Hmmm...")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment