Skip to content

Instantly share code, notes, and snippets.

@vinibaggio
Created October 21, 2012 03:59
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 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