Skip to content

Instantly share code, notes, and snippets.

@eob
Created December 7, 2010 09:23
Show Gist options
  • Save eob/731611 to your computer and use it in GitHub Desktop.
Save eob/731611 to your computer and use it in GitHub Desktop.
Why Scala Syntax is Scary
object ListCase {
def matcher(l:List[Int]) {
l match {
case List(1,3,5,7) => println("Primes")
case List(_,_,_,3,_) => println("3 on 3")
case 1::rest => println("List starting with 1")
case List(_*) => println("Other list")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment