Proposal: opt-out local scoping

Ingvar von Schoultz ingvar-v-s at comhem.se
Thu Aug 28 14:59:02 PDT 2008


Dave Herman wrote:
> Reformed `with' depended on type annotations and structural type syntax, 
> which are undergoing discussion. So I think reformed `with' is up in the 
> air for now.

I find it odd that reformed |with| required such exact type
annotations, when nothing else does. It would seem that these
are very similar, from an early-binding viewpoint:

     var {a, b, c} = fn();
     x = a;

     var obj = fn();
     x = obj.a;
     with (obj : {a, b, c})
     {   x = a; // Desugars to obj.a
     }

Equally it would seem that disambiguating syntax would allow
early binding, if it were enforced:

     with (obj)
     {   x = .a; // Desugars to obj.a
         y = a;  // From the lexical scope
     }

-- 
Ingvar von Schoultz



More information about the Es-discuss mailing list