> 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)

Ah, that makes sense. I previously didn’t understand why invoke-only methods 
were a problem.

In some ways, invoke-only methods do reflect how things actually work with 
proxies: they are easier to implement if you don’t have to reify a method. With 
the current API, you are forced to reify.

Doesn’t the currying incur a cost (for the frequent use case of “virtual 
methods”)? Could that cost (performance + elegance) be avoided in some other 
manner?

Axel

-- 
Dr. Axel Rauschmayer
[email protected]

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to