> If I understand your suggestion, you're proposing that non-local break and 
> continue should be exposed as standard exceptions, and then implementors of 
> loop-like abstractions could choose to catch them.
> ...
> Did I understand your suggestion correctly?

Yes. I was thinking about the BGGA closure proposal that Allen also linked to: 
http://www.javac.info/closures-v05.html

> This *may* not violate TCP (I'm not quite sure), but I'm not enthusiastic 
> about the idea. The semantics is significantly more complicated, and it 
> requires you to understand whether a higher-order function like forEach is 
> catching these exceptions or not. So it becomes an additional part of the API 
> of a function. If someone doesn't document what they do with BreakException 
> and ContinueException, then writing callbacks you won't actually be able to 
> predict what `break` and `continue` will do.

I don’t think it’s a must-have, but whenever you catch exceptions, you have 
similar issues.

-- 
Dr. Axel Rauschmayer
a...@rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to