2010/9/22 Cédric Beust ♔ <[email protected]>
>
>
> On Wed, Sep 22, 2010 at 8:19 AM, Kevin Wright <[email protected]>wrote:
>
>> Instead, a language can offer exhaustive pattern matches in a range of
>> other, non-exceptional scenarios, so offering the best of both worlds.
>
>
> In my opinion, the best of both worlds would be being able to handle
> exceptions in any stack frame with an easier syntax than Java's current one,
> possibly with pattern matching on the exception type. Unfortunately, no
> language supports both this and checked exceptions today.
>
>
Sure it does, if I widen my previous code a little:
//using try/catch
try {
val handle = fileOpen(fileName)
doSomethingWithFile(handle)
} catch {
case FileNotFoundException(e) => ...
case IOException(e) => ...
case Exception(e) => ...
case throwable(e) => ...
}
Easier syntax, full pattern matching and usable on any stack frame. But
absolutely no checked exceptions.
> --
> Cédric
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "The Java Posse" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<javaposse%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/javaposse?hl=en.
>
--
Kevin Wright
mail / gtalk / msn : [email protected]
pulse / skype: kev.lee.wright
twitter: @thecoda
--
You received this message because you are subscribed to the Google Groups "The
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/javaposse?hl=en.