Created
May 2, 2016 16:04
-
-
Save ryangreenberg/cab6c0fdf5272f40c57ff52fa503122f to your computer and use it in GitHub Desktop.
Scala wat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val s: Seq[Int] = Seq(1,2,3) | |
val a: Seq[Int] = Array(1,2,3) | |
def pp(xs: Seq[Int]) = xs match { | |
case 1 :: 2 :: 3 :: Nil => "we got a match, baby" | |
case _ => "who knows" | |
} | |
pp(s) // "we got a match, baby" | |
pp(a) // "who knows" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment