Re: David’s ProxyMap

Yehuda Katz wycats at gmail.com
Wed Oct 24 15:47:42 PDT 2012


On Wed, Oct 24, 2012 at 2:56 PM, Tom Van Cutsem <tomvc.be at gmail.com> wrote:

> 2012/10/20 Axel Rauschmayer <axel at rauschma.de>
>>
>> Currently, proxies make no distinction between a property read access and
>> a method invocation. In my experience, it would be nice if that distinction
>> would be there – if only that one didn’t have to curry for method
>> invocations which must be a performance issue and is a fairly common use
>> case (remotely invoking web services etc.). Now, there are reasons against
>> this and I’m mainly wondering if actually using the new API has changed
>> your or Tom’s mind.
>>
>
> I agree there are use cases for distinguishing method invocations from
> property accesses (remote method calls are one of them -- you'd want to
> distinguish between doing an HTTP GET vs POST). But the new API hasn't
> changed the balance for or against an "invoke" trap. Recall that one of the
> reasons was that an "invoke" trap would lead to invoke-only methods, which
> goes against functional programming patterns in Javascript (e.g. people
> expect array.map(obj.method) to work)
>

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?


>
> 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/ae095fca/attachment.html>


More information about the es-discuss mailing list