Created
October 21, 2012 03:59
-
-
Save vinibaggio/3925634 to your computer and use it in GitHub Desktop.
Example of pattern matching in scala
This file contains 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
// 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