Re: [Scheme-reports] <body> of let-syntax
John Cowan 20 Jan 2014 04:46 UTC
Jim Rees scripsit:
> ...for that matter shouldn't it also be "zero or more expressions" ?
>
> ..and while this may already have been mentioned in the past, it may
> not be possible to decide what the elements of <body> are (definitions
> or expressions) until after expanding them using the syntax definitions
> provided.
No. This is one of the places where R5RS, R6RS, and R7RS differ.
In R5RS, there is an inconsistency between 4.3.1, which says that the
<body> of a `let-syntax` consists solely of expressions, and 5.2.2 and
the formal syntax in 7.1.3, which say that <body> may have internal
definitions as well. `Let-syntax` is a block contour, and any internal
definitions are local to that contour.
In R7RS, 4.3.1 was adjusted (incorrectly) to agree with the other
two cases. That makes `let-syntax` work like `let`.
In R6RS, however, `let-syntax` is like `begin`: when used in a definition
context, its <body> must consist of definitions, but when used in a
expression context, its <body> must consist of expressions. In the former
case, the definitions are spliced into the surrounding lexical contour.
I have made the correction in the repo, and added the correction as
erratum 13 to the R7RSSmallErrata page on the wiki.
--
John Cowan cowan@ccil.org http://ccil.org/~cowan
Half the lies they tell about me are true.
--Tallulah Bankhead, American actress
_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports