Skip to content

Instantly share code, notes, and snippets.

@kings13y
Created March 22, 2011 22:19
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 kings13y/882212 to your computer and use it in GitHub Desktop.
Save kings13y/882212 to your computer and use it in GitHub Desktop.
Simple example of Constant pattern matching
val FOO = 1
val BAR = 2
val x = 2
x match {
case FOO => "matched a FOO !"
case BAR => "matched a BAR !"
case _ => "matched NOTHING !"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment