Class double-bind

Andreas Rossberg rossberg at google.com
Wed Mar 4 14:41:36 UTC 2015


For the record, I strongly dislike the function behaviour. Turning a
function expression into a declaration silently changes the meaning of
internal recursive references, in ways that many people find very
surprising. That is an unnecessary pitfall.

Your argument essentially is that you want to be able to do some AOP-style
hacking on (otherwise internal) class bindings. But as Allen pointed out,
that isn't reliable anyway, nor would it work for classes that do not
happen to be defined using class declaration syntax. So I think it is a
fairly weak argument. It is even preferable that the language does not
encourage such brittle patterns.

In summary, I'm glad that we did not adopt this behaviour for classes.

(On the other hand, I do think that it probably was a serious mistakes to
make class bindings mutable.)

/Andreas



On 4 March 2015 at 13:23, Jason Orendorff <jason.orendorff at gmail.com> wrote:

> I guess we are just going to disagree here. Double bindings with
> mutability still seem clearly bad. I can't make sense of the rationale
> that classes can cope with every external binding being mutable except
> for, somehow, their own name, and we're doing users a favor by
> "protecting" them from "tampering" for just this one binding in this
> one place.
>
> -j
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150304/ffe5b90e/attachment.html>


More information about the es-discuss mailing list