Re: The most general form of let/let*
Jeremy Steward 17 Nov 2022 01:53 UTC
On 11/15/22 13:35, Daphne Preston-Kendal wrote:
> I file improvements like this to let under ‘things we’d do differently if we did Scheme again from scratch, but it’s too late now’.
>
> Personally I’d have three forms: let (which would be what we currently call letrec*), recur (which would be what we currently call named let), and let-syntax (which would be what we currently call letrec-syntax).
>
Aside from the first, which is just called |let|, there's really no
reason there can't be an SRFI that introduces |recur| as some kind of
looping construct.
named-let is itself a bit of a wart. I use it frequently and I often go
back to it, but so so so many folks can't wrap their heads around the
fact that the |let| syntax has at least 3 major interpretations around
what could be much more clearly expressed with a separate macro.
I know it's a bit of a digression on the topic but I also recall Marc is
working on some kind of looping macro for Scheme. I think I merely want
to express support that something like |let-values| and also a |recur|
macro of some kind would be very welcome even if they don't offer much
over the standard forms.
Eventually if you replace enough uses of let you can retire it :)
> The explosion of near-identical let forms, and the need to nest them sometimes, is a wart, but adding more just creates an xkcd 927 situation.
>
>
> Daphne
Meh, this isn't a new situation in software and I don't think the SRFI
process is over-burdened by different |let| bike-shedding.
--
Jeremy Steward