Closures and let blocks

Igor Bukanov igor at mir2.org
Thu Jan 3 11:41:19 PST 2008


On 03/01/2008, Brendan Eich <brendan at mozilla.org> wrote:
Igor was applying rude
> deduction of the Scheme sort: compositional primitiives, not gotchas
> or asymmetric restrictions.

In fact I was wrong about the symmetry here.

Consider:
  { let function f() { ... f()... }; ... }
versus hypothetical
  let (function f() { ... f()... }) { ... }

In the first case f() refers to the let-bounded f and this is clear.

In the second case if f() would also refer to the let-bounded f(), it
would require an extra special scoping rule. And if f() would refer to
the outer f, then it breaks the symmetry with the declaring f.

So one way or another the symmetry is broken meaning an extra
complexity for the implementations and extra rules for a user to
learn.

Regards, Igor



More information about the Es4-discuss mailing list