> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Brendan Eich > Sent: 3. januar 2008 18:45 > To: Igor Bukanov > Cc: [email protected] > Subject: Re: Closures and let blocks > > On Jan 3, 2008, at 9:36 AM, Igor Bukanov wrote: > > > On 03/01/2008, Brendan Eich <[EMAIL PROTECTED]> 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. > > Oops, sorry -- pre-caffeine here. I misread that lambda as a > named function expression. But it's anonymous, and its scope chain (as > noted) starts with the let's outer scope, so it won't find > itself bound to the name f. > > > 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. > > Outer, no question. > > > 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() { }; > > I missed that if so -- did you see this in the wiki, a trac > ticket, or another doc?
Ditto -- news to me if "let (function f() ...) ..." has a meaning. The analogy of "let function" is to "let const" and plain let-is-the-new-var "let". I don't recall having a "let (const x...) ..." form either. --lars > > /be > > _______________________________________________ > Es4-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es4-discuss > _______________________________________________ Es4-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es4-discuss
