Quasis: assignable substitutions?

Mark S. Miller erights at google.com
Fri Jun 17 16:35:19 PDT 2011


On Fri, Jun 17, 2011 at 2:42 PM, Mike Samuel <mikesamuel at gmail.com> wrote:

> 2011/6/17 Mark S. Miller <erights at google.com>:
> > On Fri, Jun 17, 2011 at 1:50 PM, Mike Samuel <mikesamuel at gmail.com>
> wrote:
> >>
> >> 2011/6/17 Mark S. Miller <erights at google.com>:
> >> > A failed strict assignment throws, and therefore a failed ES-next
> >> > assignment
> >> > does. So are you sure it does not currently throw? From your
> expansion,
> >> > I'd
> >> > expect it does.
> >>
> >> The SVE of ${x} in the slot expansion variant is
> >>
> >>    function() { return x; }
> >>
> >> which silently fails to assign to x when passed a value.
> >
> > I see. I think I misunderstood the question.
> > In any case, I'd like to propose an alternate slotification you and I
> have
> > talked about:
> >     "${x}" continue to expand to "x", as in the current not-slotified
> > proposal.
> >     "${=x}" expand to
> >     ice9({
> >         get: function() { return x; },
> >         set: function(newVal) { x = newVal; }
> >     })
> > where ice9 freezes the record, the functions within the record, and the
> > prototypes of those functions, since syntactic expansions should not
> > introduce new implicit communications channels. But the point here isn't
> > ice9.
>
> Shouldn't ice9 enumerate all reachable properties from its starting
> point and then delete them all?


Why? What do you have in mind?

All I was thinking was the equivalent of:

Given
    function freezeFunc(func) {
        Object.freeze(func.prototype);
        return Object.freeze(func);
    }
then
    Object.freeze({
        get: freezeFunc(function() { return x; }),
        set: freezeFunc(function(newVal) { x = newVal; })
    })

had we const functions or #-functions, this wouldn't be so hard to say.



-- 
    Cheers,
    --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110617/bd952f13/attachment.html>


More information about the es-discuss mailing list