[R6RS] a proposed change/clarification to library semantics

William D Clinger will at ccs.neu.edu
Sun Aug 13 09:06:56 EDT 2006


I propose the following change (or possibly clarification)
to the semantics of libraries:  An identifier may be
imported in two or more ways, provided all imported
denotations are equal.

Rationale:  Without this rule, programmers would have to
exclude things like fixnum-width and greatest-fixnum when
importing both the fixnum and fx libraries.  A careful
examination of our proposed libraries would probably turn
up several other examples, and similar examples could be
found in MzScheme and other systems.

Rough sketch of semantics:  Identifiers can denote one of
several things:

    locations x boolean
        (where #t indicates assignment is permitted)
    core forms
        (e.g. the denotations of if and lambda)
    derived forms
        (e.g. the denotation of a macro)

The assignment boolean will be #t for variables that are
defined in the library, and #f for variables that are
imported.  (Derived forms include their own syntactic
environments, which may contain denotations for which the
assignment boolean is #t, but that doesn't affect the
issue here.)

Even without the proposed rule, implementations must keep
track of both the location and the assignment boolean, so
the proposed rule adds no additional book-keeping.

Will



More information about the R6RS mailing list