What is an array?

2011-03-30 Thread David Bruant
Hi, I have recently read http://wiki.ecmascript.org/doku.php?id=strawman:es5_internal_nominal_typing and in particular Array.isArray should test for presence of special [[DefineOwnProperty]] rather than testing [[Class] (There is a typo, by the way) which has woken up one fundamental question

Re: What is an array?

2011-03-30 Thread David Bruant
Le 30/03/2011 12:30, David Bruant a écrit : (...) Nevertheless even if setting [[Class]] to arrays it wouldn't make them Arrays just because some string has the right value. (...) Nevertheless even if setting [[Class]] to Array it wouldn't make resulting objects Arrays just because some

Re: extends keyword instead of superclass ...

2011-03-30 Thread Dmitry A. Soshnikov
On 30.03.2011 1:24, Allen Wirfs-Brock wrote: On Mar 29, 2011, at 12:14 AM, Dmitry A. Soshnikov wrote: On 29.03.2011 2:51, Allen Wirfs-Brock wrote: ... Regarding classes in general I have the following table of classes kinds: |first-class | second-class (or

Re: Inner functions and outer 'this' (Re: That hash symbol)

2011-03-30 Thread Sam Tobin-Hochstadt
On Tue, Mar 29, 2011 at 7:08 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Mar 29, 2011, at 3:03 PM, Sam Tobin-Hochstadt wrote: On Tue, Mar 29, 2011 at 2:19 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: JavaScript up to this point seems to have done a pretty good job of

Re: Inner functions and outer 'this' (Re: That hash symbol)

2011-03-30 Thread Allen Wirfs-Brock
On Mar 30, 2011, at 5:06 AM, Sam Tobin-Hochstadt wrote: On Tue, Mar 29, 2011 at 7:08 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: [snip] Optionally allowing explicit use of an alternative receiver name is probably acceptable as long as there is a default name. The OO tradition is

Re: Inner functions and outer 'this' (Re: That hash symbol)

2011-03-30 Thread P T Withington
On 2011-03-29, at 17:52, Allen Wirfs-Brock wrote: On Mar 29, 2011, at 1:12 PM, P T Withington wrote: If I had a vote, it would be for a way to explicitly name the `-1th` argument to a function. And I would wish for it to be available in all function forms, defaulting to using the legacy

Re: Inner functions and outer 'this' (Re: That hash symbol)

2011-03-30 Thread P T Withington
On 2011-03-29, at 17:38, Brendan Eich wrote: [...] We did not discuss allowing |this| to be bound otherwise, *except* #foo(this = this| arg1, arg2) {...} Am I right in understanding the above to be an idiom for trampolining the outer `this` binding into the closure? (With the hazard that

Re: Inner functions and outer 'this' (Re: That hash symbol)

2011-03-30 Thread David Herman
If I've got this right, the idea of soft bind is that the function distinguishes whether it's called as a function or as a method; if called as a function, it uses the lexical binding of |this|, and if called as a method, it uses the dynamically pass-in binding of |this|. Note that the .call

Re: Inner functions and outer 'this' (Re: That hash symbol)

2011-03-30 Thread Brendan Eich
See http://wiki.ecmascript.org/doku.php?id=strawman:soft_bind for the method-API proposal. /be On Mar 30, 2011, at 2:11 PM, David Herman wrote: If I've got this right, the idea of soft bind is that the function distinguishes whether it's called as a function or as a method; if called as a

Re: What is an array?

2011-03-30 Thread Allen Wirfs-Brock
David, That wiki page and the working document it links to was intended to stir up exactly these sorts of questions. There are recurring discussions about various situations where it may be useful to categorize ECMAScript objects and how to go about creating objects that fit into various