Skip to content

Instantly share code, notes, and snippets.

@vinibaggio
Created October 21, 2012 03:59
Show Gist options
  • Save vinibaggio/3925634 to your computer and use it in GitHub Desktop.
Save vinibaggio/3925634 to your computer and use it in GitHub Desktop.
Example of pattern matching in scala
// Pattern matching <3
scala> val X = 'b'
X: Char = b
scala> val List(_, (X, x)) = List(('a', 1), ('b', 2))
x: Int = 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment