[R6RS] syntax-case and shared structure
William D Clinger
will at ccs.neu.edu
Sun Sep 3 10:54:44 EDT 2006
In the chapter on syntax-case, the third paragraph
begins
Because syntax-case does not require literals,
including quoted lists or vectors, to be copied
or even traversed, it preserves sharing and
cycles within and among the constants of a
program.
While this is true for syntax-case considered in
isolation, some readers might misinterpret that
sentence to mean that sharing and cycles within
and among the constants of a program are preserved
by syntax-case macros even when programs are
compiled.
It is highly unlikely that this sharing will be
preserved by separate compilation, which is the
first of the explicit goals listed for the
library system. It is unlikely that this sharing
will be preserved even within a single compilation
unit, especially when compiling to written forms
of C, JVM byte code, Microsoft's CIL, or other
intermediate languages (even Scheme!) that have no
natural representation for sharing between distinct
structures.
Since the sentence in question appears to have
been intended as a factual statement, not as a
normative statement, I think the easiest fix is
to rewrite the sentence as follows:
Because syntax-case does not require literals,
including quoted lists or vectors, to be copied
or even traversed, it may be able to preserve
sharing and cycles within and among the constants
of a program.
It would be nice to do this before public release.
Will
More information about the R6RS
mailing list