Closures and let blocks

Igor Bukanov igor at mir2.org
Thu Jan 3 09:36:07 PST 2008


On 03/01/2008, Brendan Eich <brendan at mozilla.org> wrote:
> > let (f = function() { ...  f() ... }) { ... }
>
> The call to f within itself always refers to itself.

I do not see how ES3 is relevant to this second case. So I would like
to clarify if in

function f() { }

let (f = function() { ...  f() ... }) { ... }

f() should refer to the outer f or let-bound f.

> > let (function f() { print("f is called"); f(); }) {
>
> This is not valid syntax. The let head should contain optionally
> annotated, optionally initialised, unqualified variable names, comma-
> separated.

I thought that function definitions in the let blocks like in let
(function f()) { } is supported for uniformity with let declarations
that allow a usage like:

let function f() { };

Regards, Igor



More information about the Es4-discuss mailing list