Skip to content

Instantly share code, notes, and snippets.

@loverdos
Created October 14, 2014 10:50
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 loverdos/ac2c683f353da03e2a2d to your computer and use it in GitHub Desktop.
Save loverdos/ac2c683f353da03e2a2d to your computer and use it in GitHub Desktop.
Enhanced Scala match with exception handling
// Inspired by latest OCaml
eval() match {
case v1 =>
case v2 =>
case _ =>
case catch e: Exception =>
case catch _ =>
case finally =>
}
// or
eval() match {
case v1 =>
case v2 =>
case _ =>
catch e: Exception =>
catch _ =>
finally =>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment