Hi Charles,

this is a very good idea and I can see no downsides. Those exception  
types could also automatically be setup to not create a stack trace  
(which saves a lot of overhead). I've been using Error exception for  
this myself (seems Scala does too), but a dedicated type that nobody  
is catching would be a good improvement.

Geert

On 20 Oct 2007, at 06:59, Charles Oliver Nutter wrote:

>
> With more and more discussion about closures and non-local flow  
> control
> and various stack-manipulating events becoming part and parcel on the
> JVM, it seems like we need to introduce a new exception type.
>
> There's two reasons for this:
>
> - catch (Throwable t) or catch (Error e) would break current non-local
> flow control mechanisms based on exceptions or errors
> - some of you whiners don't like us using exceptions or errors for
> non-local flow control
>
> So, what about a new type of exception-like feature: Jump
>
> public class Jump {}
>
> public class NonLocalReturn < Jump {
>    Object returnValue;
> }
>
> Jumps would not be catchable as either errors or throwables, though  
> they
> would still trigger finally blocks. Because they'd be a new class of
> exception-like feature, no existing code would be incorrectly  
> trying to
> catch them. And they're explicitly stated to be used for these  
> sorts of
> "jump" events.
>
> Thoughts?
>
> - Charlie
>
> >

--
Geert Bevin
Terracotta - http://www.terracotta.org
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM 
Languages" 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/jvm-languages?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to