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)

Erratum requested (what is a BODY?) Marc Nieper-Wißkirchen 23 Oct 2020 14:00 UTC

In SRFI 2, the syntax of the and-let* special form is given as

(and-let* (CLAWS) BODY)

However, it doesn't exactly say what is meant by BODY. Given that
and-let* is advertised as a cross-breed of let* and given the expected
behavior of binding forms, it makes sense to assume that BODY is to be
understood in the sense of a <body> of the R5+RS, that is a sequence
of definitions followed by a non-empty sequence of expressions.

The formal denotational semantics does not help much to clarify the
issue. They contain a BEGIN, but it isn't specified whether BEGIN is
assumed to be the splicing or the expression version of R5+RS (or
something else). Incidentally, the R5RS and R7RS also don't handle
internal definitions in their denotational semantics but rely on
syntax expansion first, which rewrites internal defines into an
equivalent letrec* form.

It would look like an obvious design mistake if the BODY of an
and-let* weren't equivalent to the BODY of a let* form (and, moreover,
would be quite unconventional for a binding form), so I would like to
request an erratum or amendment of SRFI 2 specifying that BODY is a
<body> in the sense of R5+RS. (As, in particular, the use of BEGIN is
currently underspecified, this doesn't break conforming code.)

As the sample implementation doesn't handle internal defines, it will
have to be (trivially) updated.

Marc