Short Functions

David Griffiths dxgriffiths at gmail.com
Wed May 25 22:18:02 PDT 2011


To emphasize the point... we need meat, not sugar.

And even then, maybe not even the meat.


On 22/05/2011, at 10:28 AM, Isaac Schlueter wrote:

I very much want short functions.  However, the semantics of
JavaScript lambdas are so wonderfully simple.

Adding a semantically different callable thing is a huge mistake, in
my opinion.  I'd love to be able to write

   {|a, b, c|  a + b * c }

or even

   (a, b, c) -> { a + b * c }

or

   #(a, b, c) { a + b * c }

instead of

   function (a, b, c) { return a + b * c }

but I really don't want to replace our existing simple semantics.

I see a lot of the discussions of short function syntax seeming to
imply ruby-block semantics, with the "return returns from the parent"
idea.  It would be great to separate those two concerns.  They are
very different.  One is sugar, the other is a much more radical change
to the way the language works, which I'm not altogether convinced is a
good or useful thing.

--i
_______________________________________________
es-discuss mailing list
es-discuss at mozilla.org
https://mail.mozilla.org/listinfo/es-discuss



More information about the es-discuss mailing list