Allen Wirfs-Brock (2013-07-30T22:19:39.000Z)
On Jul 30, 2013, at 2:21 PM, Till Schneidereit wrote:

> On Tue, Jul 30, 2013 at 10:19 PM, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:
> I was really asking about purpose of application level Array.isArray tests.  What is the application really asking when it uses that test? Is it really asking "array-like"?  What counts as "array-like"?
> 
> My guess is: whether the generic Array methods work for this object. Which is a sensible thing to want to know, and which, imo, Array.isArray *seems* to provide, if you don't know better.
> 

In which case, we are talking about bogus tests because that isn't really what Array.isArray determines and the generic Array methods will work (to some degree or another) on any object. 

We could define a new predicate Array.isArrayLike with a proxy friendly extensions mechanism (@@isArrayLike).  It wouldn't be the same test as Array.isArray and the result would be more a statement of intent than an absolute guarantee.

Would anybody use it? Would it's existence be enough to eliminate the Array.isArray/proxy concern?

Allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130730/4339fd95/attachment.html>
domenic at domenicdenicola.com (2013-08-04T22:54:59.571Z)
On Jul 30, 2013, at 2:21 PM, Till Schneidereit wrote:

> My guess is: whether the generic Array methods work for this object. Which is a sensible thing to want to know, and which, imo, Array.isArray *seems* to provide, if you don't know better.

In which case, we are talking about bogus tests because that isn't really what Array.isArray determines and the generic Array methods will work (to some degree or another) on any object. 

We could define a new predicate Array.isArrayLike with a proxy friendly extensions mechanism (@@isArrayLike).  It wouldn't be the same test as Array.isArray and the result would be more a statement of intent than an absolute guarantee.

Would anybody use it? Would it's existence be enough to eliminate the Array.isArray/proxy concern?