Closed Artazor closed 8 years ago
The appropriate place to bring something like this up is esdiscuss and not here @Artazor
Sorry for the offtopic, @benjamingr I've tried several times before this to subscribe to esdiscuss using https://mail.mozilla.org/subscribe/es-discuss
It replied on the website
Your subscription request has been received, and will soon be acted upon.
Depending on the configuration of this mailing list, your subscription request
may have to be first confirmed by you via email, or approved by the list moderator.
If confirmation is required, you will soon get a confirmation email which contains
further instructions.
And no further effect. No mails, no ability to write to the mail list... Should I write directly to @BrendanEich as it indicated that
es-discuss list run by brendan at mozilla.org, allen at wirfs-brock.com
?
@Artazor Thanks for your enthusiasm, and I haven't given up. I believe that the semantics for the Babel transform are exactly what you suggest, no?
I still believe like class
is not just sugar and is not entirely replaceable by function
, this operator could be something more than just .bind
, something more needed, not just a shortcut.
I also agree this is not the place to discuss this, but I also don't understand what are your concerns @Artazor since AFAIK what you are saying is exactly the (IMO unfortunate) current status.
@zenparsing, @WebReflection my proposal here is to sacrifice memoization. This proposal is based on the assumption that bind
and apply
will be never deprecated/changed (is it false assumption?) and we would need to learn two different ways how to solve the same problem (bind
and ::
)
Ok, I've finally subscribed to ES-discuss and will write there.
The only obstacle I see is the disagreement on whether
and
I believe that the establishing equality is against the current (not ideal) implementation of Function.prototype.bind and will introduce inconsistency in the language.
Yes, it is an initial design flaw of the JavaScript that
f.bind(obj) !== f.bind(obj)
.In an ideal world there should be two separate methods
and
Where
bindThis
binds onlythis
and keeps normal arguments intact. And of coursef.bindThis(obj) === f.bindThis(obj)
. AndbindArgs
that keepsthis
intact and performs a partial appliaction. And, of course,f.bindArgs(x,y,z) !== f.bindArgs(x,y,z)
.The problem is that
bindArgs
andbindThis
are conflated intobind
by the initial design. @BrendanEich are you agree?Now it is too late to split them apart. So the least painful solution is to agree that
f.bind(obj) !== f.bind(obj)
(reasonable sacrifice the memoization) and move on.@zenparsing please don not give up!