Re: Type Checking?

2007-10-10 Thread Garrett Smith
On 10/10/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Oct 10, 2007, at 3:53 PM, Garrett Smith wrote: > > > Typechecking is a problem. > > > > typeof is limited and allows host objects to return anything. The > > problem is that some host objects return "function", for example, a > > NodeList in

Re: Type Checking?

2007-10-10 Thread Brendan Eich
On Oct 10, 2007, at 3:53 PM, Garrett Smith wrote: > Typechecking is a problem. > > typeof is limited and allows host objects to return anything. The > problem is that some host objects return "function", for example, a > NodeList in Safari. This is perfectly legal, according to the spec. See http

Re: Type Checking?

2007-10-11 Thread Garrett Smith
On 10/10/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Oct 10, 2007, at 3:53 PM, Garrett Smith wrote: > >if (it is Callable) ... > > > The |is| operator tests universal or Platonic type, which involves > shared, immutable type descriptors that do not vary across windows or > frames. So > >

Re: Type Checking?

2007-10-11 Thread Mike Shaver
On 10/11/07, Garrett Smith <[EMAIL PROTECTED]> wrote: > If an object accepts arguments, it is callable, and if it is callable, > it supports ,call(), right? Assuming you mean "has itself a Callable member named 'call'", then I think the answer is no -- being Callable means having a [[Call]] operat

Re: Type Checking?

2007-10-11 Thread Brendan Eich
On Oct 11, 2007, at 1:36 PM, Garrett Smith wrote: > On 10/10/07, Brendan Eich <[EMAIL PROTECTED]> wrote: >> On Oct 10, 2007, at 3:53 PM, Garrett Smith wrote: >>if (it is Callable) ... >> > I wonder how host objects will deal with this. > > Will there be a transitive relationship of callable an

Re: Type Checking?

2007-10-11 Thread Garrett Smith
On 10/11/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Oct 11, 2007, at 1:36 PM, Garrett Smith wrote: > > > On 10/10/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > >> On Oct 10, 2007, at 3:53 PM, Garrett Smith wrote: > >>if (it is Callable) ... > >> > > I wonder how host objects will deal wit

Re: Type Checking?

2007-10-11 Thread Garrett Smith
Incomplete sentence > Microsoft often says that it is necessary to retain backwards > compatibility. I would hope they would [not continue on this path.] <-- EDIT. > ___ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/e

Re: Type Checking?

2007-10-11 Thread Brendan Eich
On Oct 11, 2007, at 8:02 PM, Garrett Smith wrote: >> If you want to apply or call a non-function >> callable, use Function.apply(callable, thisp, argArray) or >> Function.call(callable, thisp, arg1, ...argN). >> > So these are equivalent? > > aNonFunctionCallableObj() > Function.call( aNonFunction

Re: Type Checking?

2007-10-11 Thread Garrett Smith
On 10/11/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Oct 11, 2007, at 8:02 PM, Garrett Smith wrote: > > >> If you want to apply or call a non-function > >> callable, use Function.apply(callable, thisp, argArray) or > >> Function.call(callable, thisp, arg1, ...argN). > >> > > So these are equiv

Re: Type Checking?

2007-10-12 Thread Brendan Eich
On Oct 11, 2007, at 10:36 PM, Garrett Smith wrote: > So that that's out of scope for ES4; it's OK for host objects to have > custom behavior. I'm afraid so, but we could say that host objects that are callable SHOULD be functions if they appear to be functions otherwise; we could say that all