Not sure what's vague about it. I can only refer you once again to the link I originally posted for a full explanation of this. As to whether other languages you mention satisfy this requirement, to be honest, I'm not 100% certain because I'm not familiar enough with said languages. I can say the following:
C# certainly has non-local returns in the form of yields. Scala apparently has some continuation support in the form of a library in 2.8 -- my grasp on this is very shaky. But the end result is not whether language X or Y supports or doesn't support closures. The important debate I think is whether what Java has (whether we choose to call it closures or not) is generally sufficient. I say yes. My biggest gripe is not so much with non-local returns, but with exception propagation. Some baby steps were taken toward that goes in java.util.concurrent, but it's quite limited and its abstractions leak badly into Java's type and exception systems. But it's a hard problem anyway you cut it and I'm not overly upset. It is what it is. Know it and work with it, I say it. Alexey ________________________________ From: clay <[email protected]> To: The Java Posse <[email protected]> Sent: Wednesday, September 14, 2011 10:19 AM Subject: [The Java Posse] Re: Java Has Always Had Closures That's a completely vague explanation. Which specific control flow behavior is required for full closure functionality? What about exception propagation isn't being done correctly? I've never heard this point before. I thought closures were specifically about "closing" over the environment of the outer function. Would you consider JavaScript to have the correct control flow/ exception propagation behavior to qualify as supporting full closures? How about Scala, Clojure, Haskell, C#, and the old FX Script? On Sep 14, 2:10 am, Alexey Zinger <[email protected]> wrote: > Folks, I mentioned this earlier, but no one seemed to pick up on it. The one > real difference between closures and constructs like Java's SAM's or > anonymous functions is how control flow is treated. Not just in trivial > cases like branching and looping, but think about continuations, exception > propagation, etc. This is where Java comes up short if you wanna do those > things. My understanding is that Java 8 syntax doesn't address this, so > we're still stuck using whatever we had before, but with cleaner, nicer > presentation (syntax). Again, not something I consider a deal breaker, but > an important factor nonetheless. -- 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. -- 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.
