Erratum requested (what is a BODY?) Marc Nieper-Wißkirchen (23 Oct 2020 14:00 UTC)
Re: Erratum requested (what is a BODY?) Arthur A. Gleckler (23 Oct 2020 14:50 UTC)
Re: Erratum requested (what is a BODY?) Marc Nieper-Wißkirchen (25 Oct 2020 08:44 UTC)
(missing)
Re: Erratum requested (what is a BODY?) Arthur A. Gleckler (26 Oct 2020 18:25 UTC)
Re: Erratum requested (what is a BODY?) Marc Nieper-Wißkirchen (26 Oct 2020 18:32 UTC)
Re: Erratum requested (what is a BODY?) Alex Shinn (27 Oct 2020 05:55 UTC)
Re: Erratum requested (what is a BODY?) Marc Nieper-Wißkirchen (27 Oct 2020 06:39 UTC)

Re: Erratum requested (what is a BODY?) Marc Nieper-Wißkirchen 27 Oct 2020 06:39 UTC

Am Di., 27. Okt. 2020 um 06:55 Uhr schrieb Alex Shinn <xxxxxx@gmail.com>:
>
> Nitpick: could we use let instead of let*?
>
> Since there are no bindings it doesn't matter, but let is shorter, is generally what let* expands into, and is the typical idiom for "create a new lexical contour."

From a logical point of view, LET* is the better choice for the idiom
"create a new lexical contour". (Apart from that this SRFI is about
and-let* and not and-let.)

Both LET and LET* create a new lexical contour, but LET (when it is
explained in terms of LAMBDA) logically also creates a new activation
frame. LET*, on the other hand, logically creates as much activation
frames as there are bindings, which means LET* without bindings
creates only a lexical contour but no activation frame, at least
logically.

Of course, implementations can choose to implement LET* in terms of
LET, which will always create a, possibly, superfluous activation
frame (that may be optimized away later), but in fact, LET* without a
single binding could be handled completely in the expander without
expanding into any more primitive form. In some sense, the meanings of
LET and LET* without bindings are equivalent up to one beta-reduction.

Therefore, I would like to stick to LET*, which conveys the meaning
more precisely.

Anyway, as Alex already said, it doesn't matter for the semantics of
this SRFI, nor does it restrict an implementer.

-- Marc

PS I just looked into Chez's source code. There, a LET* without
bindings is indeed not expanded in a superfluous LET or LAMBDA but
just creates a lexical contour, which only matters to the expander.