Alex Shinn <xxxxxx@gmail.com> schrieb am Mo., 24. Juli 2017 um 05:23 Uhr:
On Sun, Jul 23, 2017 at 8:18 PM, Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de> wrote:
I just noticed that, in fact, both the R6RS and the R7RS version of let(rec)-syntax are backward-compatible with the R5RS, they are just not mutually compatible.

The body of an R5RS-let(rec)-syntax is not spliced into the surrounding context, and the R7RS retains this semantics making both compatible. R6RS, however, has splicing semantics.

In the R5RS, however, it says, however, that the <body> of a let(rec)-syntax should be a sequence of one or more expressions (while the R7RS allows the <body> to a sequence of definitions followed by one or more expressions).

In the absence of definitions, however, there is no semantic difference between splicing the body in the surrounding context or not. Thus the R6RS is as well backwards-compatible with the R5RS.


I'm assuming you're referring to the text in R5RS 4.3.1 stating that for let[rec]-syntax:

  [...] <body> should be a sequence of one or more expressions.

Yes.
 
I think the explicit description of internal definitions in R5RS 5.2.2 makes it clear
that internal definitions are allowed.  If you want to argue that the text from 4.3.1
precludes extensions, then you must also apply the same reasoning to 4.2.2,
where for let[*,rec] it states:

  [...] <body> should be a sequence of one or more expressions.

and similarly in 4.1.4 describing lambdas:

  [...] <body> should be a sequence of one or more expressions.

This would be absurd, so we can only assume internal definitions are allowed
everywhere described in 5.2.2, and are required to be non-splicing.

I didn't notice that so I thought let(rec)-syntax was special by not allowing definitions. So may argument is rendered moot, and I agree with you.
 
So R6RS is incompatible with R5RS on this point, and R7RS is compatible
(revising the text to make it slightly clearer, but not in need of any errata
(apart from the existing errata #13)).

When I mentioned errata, I meant let(rec)-syntax is not on the list of incompatibilities with the R6RS on page 79.
 
I think a SRFI for let[rec]-syntax/splicing would be a good idea.

Indeed. According to the archives, some members of WG1 seemed to argue against the splicing version, or maybe against all versions (which may have led WG1 to vote for the R5RS version, but Alex and John may know better). If there is substantial, justified critique against let(rec)-syntax/splicing, it should be addressed in such a SRFI.

--

Marc