Re: David’s ProxyMap

Yehuda Katz wycats at gmail.com
Wed Oct 24 17:46:13 PDT 2012


On Wed, Oct 24, 2012 at 5:16 PM, Andrea Giammarchi <
andrea.giammarchi at gmail.com> wrote:

> But then why such "encouragement"
> https://brendaneich.com/2012/10/harmony-of-dreams-come-true/ ? ( Proxy
> paragraph )
>
> If __noSuchMethod__ is wrong, what's the point of suggesting a way to
> simulate it through proxies?
>

__noSuchMethod__ isn't the same problem as my concern about invoke-only
traps. In this case, (x = sink.bar).apply(sink) would still hit the
__noSuchMethod__ method.


>
> Moreover, what's the point to mark it wrong if many developers asked for
> it?
>
> I also remember I have written this a while ago:
> http://webreflection.blogspot.com/2011/12/please-give-us-back-nosuchmethod.html
>
> As result I see Tom's implementation with bound callbacks per property and
> a freaking slower runtime every time an API would like a fancy noSuchMethod
> behavior ... just saying :-)
>
> br
>
> On Wed, Oct 24, 2012 at 4:20 PM, Tom Van Cutsem <tomvc.be at gmail.com>wrote:
>
>> 2012/10/24 Yehuda Katz <wycats at gmail.com>
>>
>>>
>>> I'm not sure I understand the benefit of making it easy to develop APIs
>>> where foo.bar() is not roughly equivalent to (x = foo.bar).apply(foo). Am I
>>> misunderstanding something?
>>>
>>
>> No, that's indeed another way of phrasing it. Proxies don't support
>> invoke() in part because we didn't want to encourage such APIs.
>>
>> Cheers,
>> Tom
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>>
>


-- 
Yehuda Katz
(ph) 718.877.1325
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121024/decf48d9/attachment-0001.html>


More information about the es-discuss mailing list