The Artima Developer Community
Sponsored Link

Artima Developer Spotlight Forum
Are Scala's Case Classes a Failed Experiment?

15 replies on 2 pages. Most recent reply: Jul 1, 2008 7:42 AM by Derek Chen-Becker

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 15 replies on 2 pages [ « | 1 2 ]
Derek Chen-Becker

Posts: 3
Nickname: dcbdenver
Registered: Sep, 2005

Re: Are Scala's Case Classes a Failed Experiment? Posted: Jul 1, 2008 7:42 AM
Reply to this message Reply
Advertisement
Interestingly, in Scala exceptions are handled with the same pattern matching as you would use for anything else (technically a PartialFunction):


try {
...
} catch {
case iae : IllegalArgumentException => ...
case ioe : IOException => ...
case _ => ... // catches any other exceptions via wildcard
}


Note that exceptions are unchecked in Scala, so you're not actually required to catch any of them.

Flat View: This topic has 15 replies on 2 pages [ « | 1  2 ]
Topic: Are Scala's Case Classes a Failed Experiment? Previous Topic   Next Topic Topic: Scala Collection Types

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use