On 2008-08-13, at 20:04EDT, Henry Minsky wrote:

Does this
I heard good agreement on low-hanging "de-facto standard" fruit,
particularly let as the new var, to match block-scoped const as still
proposed (IIRC) in 3.1. Also some favorable comments about simple
desugarings such as expression closures and destructuring assignment,
and other changes in JS1.7 and 1.8 that do not require new runtime
semantic models.

mean that they have some way to declare vars local to a block instead of
global throughout the whole function?

Yes. A proposal for es4 was that if you say `let` instead of `var`, you get block scoping. (I'm not sure, but I think the 3.1 advocates want a `const` declaration, and they made that block-scoped, which makes `var` look weirder than ever...)

And what does are "expression closures"

As he said, this is just syntactic sugar (or lack thereof), you can write:

  function (a) a + b

instead of:

  function (a) { return a + b }

this is especially handy for functional parameters, e.g., to something like map:

  map(function (x) x + 1, [1, 2, 3]) => [2, 3, 4]

(i.e., function is the new lambda)

and "destructuring assignment" ?

Same as Lisp destructuring-bind, in theory a step toward multiple- valued functions:

  let [a, b, c] = [1, 2, 3]

binds a=1, b=2, etc.

  let {x: a, y: b, z: c} = {y: 2, z: 3, x: 1}

same bindings, but "by keyword" instead of position

Reply via email to