On Oct 22, 11:49 am, Charles Oliver Nutter <[EMAIL PROTECTED]> wrote: > Essentially, it would require that all methods dealing with closures > must throw Jump, even if the closures they're passed never use non-local > flow control, simply because *they might*. > > I think the detail you're missing here is that non-local flow control is > not a feature of the closure-friendly API you are calling, it's a > feature of the closure you're passing to it. Therefore it makes no sense > to require that all closure-accepting methods throw Jump, since in many > (most?) cases they won't, nor will they typically care if non-local > Jumps pass through them.
Maybe, you could choose to make Jump exceptions non-checked. But as a counter example consider multi-threaded code or event code where it makes no sense to have a non-local Jump. In these cases you want the compiler to tell you that you have made a mistake. It is really a matter of what you consider most important. I write quite a bit of event and multi-threaded code and therefore like catching this error. My proposal for named non-local jumps, http://www.artima.com/weblogs/viewpost.jsp?thread=182412, did include a mechanism for dealing with both cases simply. The proposal also extends Java to accept a list, possibly empty, of exceptions that can be thrown as a generic-type-var-arg. Thus if an inner class (closure) threw no exceptions then it could be passed to a method that didn't deal with exceptions, conversely if it threw a checked exception, Jump in this context, then a method it was passed to would need to deal with that exception or declare the exception itself. The main point is that we don't really need to extend the JVM, the current exception mechanism seems sufficient. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
