Expanded function syntax

Mark Filipak markfilipak.ecmascript4 at gmail.com
Thu Jan 31 17:13:44 PST 2008


Hello,

(Sorry. What I meant to write is below.)

May I make a pitch for an expanded function syntax? This example will 
say it all (I hope).

What I have to write now:

 getFirstChildOfElementWithTagName(Papa, 'baby');

What I'd like to be able to write:

 getFirstChildOfElement(Papa)withTagName('baby');

 function getFirstChildOfElement(Papa)withTagName(babyTagName) {
   alert(arguments[0].tagName);   // Show Papa's tag name
   alert(arguments[1]);   // Show desired baby's tag name
 }

I don't think such an expanded capability would have any backward 
compatibility issues. It would make function calls more readable and 
easier to remember.

Ciao -- Mark Filipak





More information about the Es4-discuss mailing list