This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home.

Source for wiki RedundantImports version 1

author

WillClinger

comment

created page

ipnr

127.11.51.1

name

RedundantImports

readonly

0

text

Importing two or more different libraries that export the same identifier with the same binding is okay in both R7RS and R6RS libraries and programs.  Importing the same identifier with different bindings is an error in R7RS and signals an error in R6RS systems, but should be permitted by an R7RS REPL (R7RS section 5.2).  This is tested by the following program:
{{{
(define-library (local 0)
  (export list car cdr x y)
  (import (scheme base))
  (define x 101)
  (define y 202))
(define-library (local x)
  (export car x)
  (import (scheme base) (local xy)))
(define-library (local y)
  (export cdr y))
  (import (scheme base) (local xy)))
(import (scheme write) (local x) (local y))
(write (list x (car (cdr (list x y)))))
(newline)
}}}
For R6RS, change `define-library` to `library`, `(scheme base)` to `(rnrs base)`, and `(scheme write)` to `(rnrs io simple)`.  To test different bindings, add new definitions of `x` and `y` to `(local x)` and `(local y)` respectively.

||'''system'''||'''version'''||'''mode'''||'''same binding'''||'''different binding'''||'''REPL'''||
||Chibi|| 0.7 || r7rs || okay || ? || ? ||
||Chicken|| 4.9.0.1 || r7rs || ? || ? || ? ||
||Foment|| 0.4 (debug) || r7rs || ? || ? || ? ||
||Gauche|| 0.9.4 || r7rs || ? || ? || ? ||
||Kawa|| 2.0 || r7rs || ? || ? || ? ||
||Larceny|| 0.98 || r7rs || okay || rejected || okay ||
||Petit Larceny|| 0.98 || r7rs || okay || rejected || okay ||
||Sagittarius|| 0.6.4 || r7rs || ? || ? || ? ||
||Larceny|| 0.98 || r6rs || okay || rejected || n/a ||
||Petit Larceny|| 0.98 || r6rs || okay || rejected || n/a ||
||Petite Chez|| 8.4 || r6rs || okay || rejected ? || n/a ||
||Racket|| 6.1.1 || r6rs || okay || rejected ? || n/a ||
||Sagittarius|| 0.6.4 || r6rs || okay || rejected ? || n/a ||
||Vicare|| 0.3d7 || r6rs || okay || rejected ? || n/a ||

The R6RS effectively forbids REPLs.

(I'll update this table when I next have access to my benchmarking machine.)

time

2015-06-01 20:26:36

version

1