[e-lang] scoping rules of when-catch
David Hopwood
david.nospam.hopwood at blueyonder.co.uk
Sat Jul 29 13:02:47 EDT 2006
Mark S. Miller wrote:
> David Hopwood wrote:
>
>> The latter -- and also to allow user-defined constructs that work in the
>> same way that 'for' and 'while' do.
>
> Then I still don't understand. When using such a construct, would the
> programmer use the "control" keyword explicitly?
Yes. This is necessary for a reviewer to be able to recognize such constructs
by a well-defined set of keywords ("for", "while" and "control").
> If so, does this implicitly bind exactly "__break" and "__continue"?
Yes.
> What about "__return"?
Local control constructs do not need to change the scope of __return:
<http://www.eros-os.org/pipermail/e-lang/2004-January/009494.html>.
However, I see that some constructs do, e.g. 'when'.
Ignoring 'to' which can remain built-in, I *think* such constructs are exactly
those that need to run a block in a different turn, for which we are using the
syntax convention "-> { block }". Perhaps the lambda-args expansion could
take this into account, treating such cases as "escape __return { block }".
--
David Hopwood <david.nospam.hopwood at blueyonder.co.uk>
More information about the e-lang
mailing list