[e-lang] scoping rules of when-catch

David Hopwood david.nospam.hopwood at blueyonder.co.uk
Sat Jul 29 10:03:24 EDT 2006


Mark S. Miller wrote:
> David Hopwood wrote:
>> Mark S. Miller wrote:
>>> David Hopwood wrote:
>>> [...]
>>>
>>>> What changes would be necessary to lambda-args to make exit constructs
>>>> like 'break' and 'continue', and similar constructs for user-defined
>>>> control abstractions, work correctly?
>>>
>>> I think the answer must be "they can't". [...]
>>
>> 'break' and 'continue' don't violate scope analyzability because each
>> 'for' and 'while' loop *always* implicitly defines these names. So, when
>> you see a 'break' or 'continue', you can apply the scope analysis rules
>> as though explicit 'break' and 'continue' definitions had been added to
>> each looping control construct, like in the example you give:
>  
> I don't understand what you're suggesting. Is it that "for" and "while"
> remain keywords, to be understood specially by the parser/expander? Or
> are you just trying to explain built-in expansions in terms of a simpler
> intermediate expansion, by introducing the "control" keyword you use below?

The latter -- and also to allow user-defined constructs that work in the
same way that 'for' and 'while' do.

-- 
David Hopwood <david.nospam.hopwood at blueyonder.co.uk>




More information about the e-lang mailing list