-
Notifications
You must be signed in to change notification settings - Fork 32
R7RSstrictMode
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
-r7strict
mode but not in-r7
mode. -
R7RS section 4.3.2 can be read as allowing an explicit ellipsis in
syntax-rules
to be one of the literals declared by that samesyntax-rules
, so that is allowed in-r7strict
mode but treated as an error in-r7
mode. -
The R6RS standard requires
let-syntax
andletrec-syntax
to 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-syntax
andletrec-syntax
to 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-r7strict
mode uses the non-splicing semantics, while-r7
uses the splicing semantics. -
R6RS lexical syntax is disabled in
-r7strict
mode but allowed in-r7
mode.
After v1.3 was released, a peculiar semantics for inexact numbers was implemented for -r7strict
mode.