[R6RS] library name ambiguities

R. Kent Dybvig dyb at cs.indiana.edu
Wed Jun 27 10:12:52 EDT 2007

> I'll do this for now for today's release.  We can always change it back.

Just a quick clarification.  Based on:

  I believe adding (library <library reference>) as an additional
  <import spec>, and favoring the keyword interpretation of "library",
  "and", "or", etc., solves the ambiguity problem in a minimal way.

I claimed that:

  For (import (except (and (1)))), this would force the first parse
  described in


  i.e., an import from a library (and) with version 1.

This is true only if parsing procedes from outermost toward innermost
layers, i.e., if we first interpret (except ...) as an "except" form
rather than work from innermost to outermost treating (and (1)) as
a version-reference.

So the text should say that import-specs are parsed outermost to
innermost, just like other Scheme forms.

To completely eliminate the ambiguity, I think we should also alter the
syntax of only, except, rename to require at least one identifier or
renaming pair, as suggested in the posted comment, i.e.:

import-set -> library-reference
           -> (only import-set identifier+)
           -> (except import-set identifier+)
           -> (prefix import-set identifier)
           -> (rename import-set (identifier identifier)+)

and similarly for version references:

version-reference -> (subversion-reference+)
                     (and version-reference+)
                     (or version-reference+)
                     (not version-reference)
subversion-reference -> sub-version
                        (>= subversion)
                        (<= subversion)
                        (and subversion-reference+)
                        (or subversion-reference+)
                        (not subversion-reference)

The usual argument for generalizing to allow zero or more subforms in each
of these cases don't apply since we can't produce library forms


More information about the R6RS mailing list