Closures and let blocks

Igor Bukanov igor at mir2.org
Thu Jan 3 08:29:09 PST 2008


For functions defined with ES4 let block, does the scope of the
closure includes the let block?

I.e will f in the following examples refer to the function itself or
to the the name from the outer scope?

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

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

I assume that f should refer to f from the outer scope to allow a usage like:

let (function f() { print("f is called"); f(); }) {
...
}

Regards, Igor



More information about the Es4-discuss mailing list