[e-lang] Bug (0.8.35f): Scope oddities in ObjectExpr with 'extends'; Kernel-E change proposal

Kevin Reid kpreid at attglobal.net
Sat Mar 11 22:36:26 EST 2006


On Mar 11, 2006, at 21:41, Mark S. Miller wrote:
> Kevin Reid wrote:
>>   ? e`def a implements (def b := 1) {}`.staticScope()
>>   # value: <[] := [] =~ ["b", "a"] + var []>
>> 'b' is visible outside.
>
> That's a bug.

OK. This will be fixed in E-on-CL shortly. (It is currently  
consistent in making the definition visible.)

>> I think this could be fixed by a minor contortion of the  
>> ObjectExpr expansion:
>
> It can't be fixed by expansion, since Kernel-E must be a subset of  
> E. Except for the awful Hilbert hotel renaming issue, a Kernel-E  
> expression expanded by the E-to-Kernel-E expansion should expand to  
> itself.

I believe it /would/ be fixable, if the intent had been to make  
'implements' expressions visible always, as in the example I gave.

> The semantics of a Kernel-E ObjectExpr should be that it exports no  
> definitions into the surrounding scope. The calculation of  
> staticScope should be fixed to reflect that.

OK. Given that, what do you think about making the 'implements'  
definitions also not visible to the object's methods?

-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>




More information about the e-lang mailing list