That makes sense, the use for this proposal is not for really for n - level forced retuning but for things like array functions or things like that

Sent: August 30, 2017 12:08 PM
Subject: Re: super return

Perhaps if the nested function is lexically inside such super function it can be fair game and actually quite powerful and liberating.

Unconstrained 'upleveling' is IIRC valid in such wonderful languages as Tcl. This unverified fact is presented without opinion :D

On Tue, 29 Aug 2017 at 16:57, Allen Wirfs-Brock <[email protected]> wrote:
On Aug 28, 2017, at 12:29 PM, Sebastian Malton <[email protected]> wrote:

The outcome of this basically means "return from current context up one level and then return from there”.

This would be a terrible violation of functional encapsulation.  How do you know that the (e.g.) forOf function isn’t internally using a encapsulated helper function that is making the actual call to the call back.  You simply have no way to predict where returning from the current context “up one” means.


A current method of doing this is by using try / catch but it is not ideal. Using the above method I believe that it would be able to be better optimized.

This technique provides a meaningful semantics because it allows the controlling outer function to define what early return means.


_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to