On Sat, Jul 22, 2017 at 5:06 PM, William D Clinger <xxxxxx@ccs.neu.edu> wrote:
Alex Shinn wrote:

> > Because the R7RS essentially retains the R5RS prose, which said nothing
> > about the matter and had therefore been interpreted as allowing both the
> > splicing semantics and the new contour semantics, the R7RS is also being
> > interpreted as allowing both the splicing semantics and the new contour
> > semantics.
>
> The relevant prose from the R5RS is in section 5.2.2 "Internal definitions:"
>
>     Definitions may occur at the beginning of a <body> (that is, the body of
>     a 'lambda', 'let', 'let*', 'letrec', 'let-syntax', or 'letrec-syntax'
>     expression or that of a definition of an appropriate form).  Such
>     definitions are known as _internal definitions_ as opposed to the top
>     level definitions described above.  The variable defined by an internal
>     definition is local to the <body>.  That is, <variable> is bound rather
>     than assigned, and the region of the binding is the entire <body>.
>
> I don't see how this can be interpreted in such a way that
> splicing is allowed (more's the pity).

I appreciate the quotation.  Despite that paragraph, some R5RS systems
(though not Larceny) were splicing, and those who had experience with
the splicing semantics regarded it as a better semantics.

Agreed that it is clearly the better semantics, as it can be used to
implement the other, and not vice versa.  There have be other
widespread bugs (features?) in R5RS implementations before though.

R7RS section 5.3.2 inserts an interesting sentence into that paragraph:

    Note that such a body might not be apparent until after expansion
    of other syntax.

If it weren't for the mentions of let-syntax and letrec-syntax in the
preceding sentence, which were absent from the R4RS, someone might interpret
that sentence as suggesting the full extent of a body containing let-syntax
or letrec-syntax might not be apparent until after macro-expansion and
splicing of any definitions that result.

Can you comment on what you believe was the intended purpose of that new
sentence?

It appears to be a purely editorial change by Arthur to "improve the explanation
of where definitions can occur."  From that commit message, I'd guess the
intent was to make clear that definitions may be expanded from other syntax
in the body.  Arthur?  Claiming it means the extent of the body itself is in
question sounds like too far a stretch, and couldn't really be applied to
let[rec]-syntax without also being applied to let, which is clearly broken.

-- 
Alex