Re: apparent bug in sample implementation of SRFI 148
William D Clinger 22 Jul 2017 08:06 UTC
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.
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?
Will