RE: ES4 draft: Function

2008-03-17 Thread Lars Hansen
Draft 2 of the spec for the Function class. Changelog near the beginning; several small changes only. --lars Title: The class "Function" The class Function NAME: "The class 'Function'" FILE: spec/library/Function.html CATEGORY:

Re: ES4 draft: Function

2008-03-13 Thread Dominic Cooney
Why doesn't Function have something like apply that does the same as in a new expression, i.e. allocate-init-and-apply? To put it another way: given arguments in an array, I want to write: F.thisThing(args) and have it mean the same as new F(args[0], args[1], ... args[n-1]) Or is what happens

Re: ES4 draft: Function

2008-03-13 Thread Garrett Smith
Hi Dustin, Well it does, apparently it was called the splat operator, which (to me) sounds a better than spread. I think it works like:- var args = [12, true]; new C(...args); function C( count, isSemiAnnual) { } - Maybe one of guys writing the specs can comment on that. It can be hacked in

Re: ES4 draft: Function

2008-03-13 Thread Dominic Cooney
Neat! Thanks for the link. Dominic On Thu, Mar 13, 2008 at 10:58 AM, Jon Zeppieri [EMAIL PROTECTED] wrote: On Thu, Mar 13, 2008 at 1:48 PM, Dominic Cooney [EMAIL PROTECTED] wrote: Why doesn't Function have something like apply that does the same as in a new expression, i.e.

Re: ES4 draft: Function

2008-03-13 Thread Waldemar Horwat
I agree with Lars on this issue for exactly the same reasons as what he stated. Waldemar ___ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/es4-discuss

Re: ES4 draft: Function

2008-03-13 Thread Waldemar Horwat
Here are my comments on this section: static public function apply(fn /*: function*/, thisArg: Object=null, argArray: Object=null) static public function bind(method /*: function*/, thisObj: Object=null, ...args) static public function call(fn /*: function*/, thisObj: Object=null,

RE: ES4 draft: Function

2008-03-11 Thread Lars Hansen
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jon Zeppieri Sent: 10. mars 2008 20:39 To: Lars Hansen Cc: es4-discuss Discuss Subject: Re: ES4 draft: Function On 3/10/08, Lars Hansen [EMAIL PROTECTED] wrote: First draft of the spec

Re: ES4 draft: Function

2008-03-11 Thread Jon Zeppieri
On Tue, Mar 11, 2008 at 10:49 AM, Lars Hansen [EMAIL PROTECTED] wrote: I think there are three points to be made here. The first is that the Function constructor provides functionality that eval does not, namely, creating new functions that are closed in the global environment only.

Re: ES4 draft: Function

2008-03-11 Thread Jon Zeppieri
I promise not to drag out this discussion, since no one else seems to be interested in it. On Tue, Mar 11, 2008 at 12:16 PM, Lars Hansen [EMAIL PROTECTED] wrote: Sure, nobody argues about that per se, but I don't see the spec as being the place to take an ideological stand about whether

ES4 draft: Function

2008-03-10 Thread Lars Hansen
First draft of the spec for the Function class. Please comment. --lars Title: The class "Function" The class Function NAME: "The class 'Function'" FILE: spec/library/Function.html CATEGORY: Pre-defined classes SOURCES:

Re: ES4 draft: Function

2008-03-10 Thread Erik Arvidsson
What is the reason to make the thisObj param to bind optional? 2008/3/10 Lars Hansen [EMAIL PROTECTED]: First draft of the spec for the Function class. Please comment. --lars ___ Es4-discuss mailing list Es4-discuss@mozilla.org

RE: ES4 draft: Function

2008-03-10 Thread Lars Hansen
-Original Message- From: Erik Arvidsson [mailto:[EMAIL PROTECTED] Sent: 10. mars 2008 17:31 To: Lars Hansen Cc: es4-discuss Discuss Subject: Re: ES4 draft: Function What is the reason to make the thisObj param to bind optional? Symmetry with call and apply and a consequence

RE: ES4 draft: Function

2008-03-10 Thread Lars Hansen
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lars Hansen Sent: 10. mars 2008 18:46 To: Erik Arvidsson Cc: es4-discuss Discuss Subject: RE: ES4 draft: Function -Original Message- From: Erik Arvidsson [mailto:[EMAIL PROTECTED] Sent

Re: ES4 draft: Function

2008-03-10 Thread Jon Zeppieri
On 3/10/08, Lars Hansen [EMAIL PROTECTED] wrote: First draft of the spec for the Function class. Please comment. Suggestion: deprecate the Function constructor and static invoke(). Almost all of its uses are better handled by function expressions and, in those cases where eval() in required,

Re: ES4 draft: Function

2008-03-10 Thread Jon Zeppieri
On 3/10/08, Erik Arvidsson [EMAIL PROTECTED] wrote: There are valid use cases for new Function (...) and Function(...). One that comes to mind is getting an attribute in DOM and make it into an event handler. Yes, the Function constructor and meta::invoke can be replaced by eval but