let* is the new var

Jon Zeppieri jaz at bu.edu
Sat Mar 22 08:13:18 PDT 2008


Was let*, possibly under some other name, ever discussed/proposed?
For let definitions, I think the following is supposed to work:

{
  let x = n;
  let y = foo(x);
  ...
}

That is, x and y should be bound sequentially, not in parallel, right?
 (An example at
http://wiki.ecmascript.org/doku.php?id=proposals:block_expressions
strongly suggests this, anyway.)  Doesn't work in the RI, but I assume
this is a bug.

However, there's no good way to do this for let expressions.  (Having
to nest the expressions leads to cluttered code.)  Also, since the
motto for let was "let is the new var," it should be mentioned that
var binds left-to-right.



More information about the Es4-discuss mailing list