On Nov 26, 2011, at 3:55 AM, David Bruant wrote:

> Le 26/11/2011 01:52, David Bruant a écrit :
>> 
>> Le 24/11/2011 22:29, Tom Van Cutsem a écrit :
>>> 
>>> 2011/11/24 Allen Wirfs-Brock <[email protected]>
>>> At the core is a root question whether we want to expose a functional or 
>>> object-oriented API for reflection functionality.
>>>  (...)
> I realize what that sentence meant yesterday, very late. And I realized also 
> that all what Tom said was legitimate. A Mirror style API ("an 
> object-oriented API") can be built on top of the Reflect API ("a functional 
> API" as I understand it). The opposite it true, but comes with an overhead. 
> Maybe in the future, it will be possible to optimize expressions like 
> "Mirror.on(object).has('bla')" (used to implement Reflect.has('bla') if the 
> Mirror style API is used), but it will always require some additional 
> analysis. The opposite is not true.
> 
> Consequently, regarding the built-in implementation, I would favor a 
> functional API as well, unless the mirror API has advantages I am oblivious 
> to.

I'm with you. JS has first class functions *and* objects, it is not an OOP-only 
or OOP-first language. The (dead? nearly) hand of Java weighed heavily on some 
parts, and methods make sense in many cases, but the cost of temporary objects 
shouldn't be imposed if a functional API at the lowest level suffices.

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

Reply via email to