Skip to content

Instantly share code, notes, and snippets.

@jamesgolick
Created November 11, 2009 23:30
Show Gist options
  • Select an option

  • Save jamesgolick/232429 to your computer and use it in GitHub Desktop.

Select an option

Save jamesgolick/232429 to your computer and use it in GitHub Desktop.
list match {
case List(_, 3, _, _) => println("Four elements, with the 2nd being '3'.")
case List(_*) => println("Any other list with 0 or more elements.")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment