Closed mnieper closed 7 years ago
The first issue is an unfortunate consequence of hygiene: rename
has a specific meaning within import forms that is incompatible with its use as a library name. Redefining rename
at the REPL removes its usual meaning, making it available as a library name.
The second issue is a consequence of forbidding redefinitions of imported identifiers within library bodies, which are unlike top-level programs and REPLs in that respect. Perhaps that prohibition should be weakened, which is why I am leaving this issue open without assigning it a milestone.
Shouldn't this be marked as a bug (or as a deviation from the R7RS)? The identifier rename
should not be bound by default in a library body.
Yes, the first issue is a bug. The components of library names are symbols or exact non-negative integers, and should have nothing to do with the denotation of the identifier rename
that's used when matching import sets or exports. The components of library names should be treated the same as field names in records.
Fixed by changeset 582c6082f1bbdfadc29d61e9848037d837b01d63
The following two issues (tested in R7RS mode with version 0.99) may be related:
(import (rename))
gives:As soon as
rename
is defined at the REPL, the import works.rename
cannot be defined in library bodies. For example,(define rename 'a)
in a library body gives: