R7RSstrictMode - larcenists/larceny GitHub Wiki
Larceny's usual R7RS mode preserves backward compatibility and interoperability with R6RS code. Some syntaxes and procedures may use R6RS semantics in addition to or instead of R7RS semantics, and R6RS lexical syntax is allowed in addition to R7RS syntax.
Larceny's -r7strict mode improves R7RS conformance at the expense of backward compatibility and interoperability. In Larceny v1.3, the differences between -r7strict and -r7 are:
-
In an R7RS program, all imports must come before all expressions and definitions, just as in R6RS programs. This is enforced in
-r7strictmode but not in-r7mode. -
R7RS section 4.3.2 can be read as allowing an explicit ellipsis in
syntax-rulesto be one of the literals declared by that samesyntax-rules, so that is allowed in-r7strictmode but treated as an error in-r7mode. -
The R6RS standard requires
let-syntaxandletrec-syntaxto splice their macro-expanded bodies into their context instead of introducing a new contour. That R6RS behavior is not explicitly forbidden by the R7RS, but archives of the working group that developed the R7RS standard record a deliberate decision to break backward compatibility with R6RS by requiringlet-syntaxandletrec-syntaxto introduce a new contour. Although the R7RS (small) standard fails to mention this significant change in semantics, that must have been an oversight. Larceny's-r7strictmode uses the non-splicing semantics, while-r7uses the splicing semantics. -
R6RS lexical syntax is disabled in
-r7strictmode but allowed in-r7mode.
After v1.3 was released, a peculiar semantics for inexact numbers was implemented for -r7strict mode.