Closures and let blocks

Lars T Hansen lth at acm.org
Thu Jan 3 10:29:47 PST 2008


On Jan 3, 2008 7:01 PM, Brendan Eich <brendan at mozilla.org> wrote:
> On Jan 3, 2008, at 9:58 AM, Igor Bukanov wrote:
>
> > On 03/01/2008, Brendan Eich <brendan at mozilla.org> wrote:
> >>> let function f() { };
> >>
> >> I missed that if so -- did you see this in the wiki, a trac ticket,
> >> or another doc?
> >
> > I have not seen this, I just assumed for some reasons that syntax for
> > let blocks and declarations is shared.
>
> Completely reasonable, both for implementations and users, IMHO.
> Lars, what do you think?

I doubt this simplifies the life for implementations even the tiniest
bit, so let's talk use cases...

I'm fairly sure that in 20 years of Scheme programming I've not felt
the need to use letrec as a nested expression (except in a context
where we'd have a block in ES4, eg under the control of "if").  I also
think the main use case for the expression form of "let" is in very
simple expression functions where there won't be a credible need for
nested functions.  Ergo I think "let (function f() ...) ..." has
doubtful utility.  Same argument for "let (const ...) ..." really; the
use cases for "let (...) ..." are unlikely to call for constant
bindings.  So my vote is "no".

--lars

>
> /be
>
>
> _______________________________________________
> Es4-discuss mailing list
> Es4-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es4-discuss
>



More information about the Es4-discuss mailing list