Concise functions, Nonexistent lambdas, Explicit tail calls

Jon Zeppieri jaz at
Tue Dec 9 17:54:45 PST 2008

On Tue, Dec 9, 2008 at 7:25 PM, Brendan Eich <brendan at> wrote:
> The relations are not simple. But I have to say that the lambda-coded for
> loop examples:
> were not what I would call clear specifications -- at least not to the
> audience of JS implementors working in C++ or a similar language, and not
> experienced lambda-coders.

Those were encodings of a for loop that binds the variables in its
initialization expression on every iteration.  It's not surprising
that it would be complicated to take a user's "i++" and, essentially,
turn it into "rebind i with i + 1."  It's also not polite.  Desugaring
a normal 'for' loop is straightforward. (Well, getting the completion
value right introduces a bit of oddness, but not much.)

for (initExpr; condExpr, updateExpr) body; ==>


  let $loop = lambda($v) {
    if (condExpr) {
      let $v0 = (lambda() { body; })();   // get the completion value of body
    } else {


More information about the Es-discuss mailing list