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. For a version of this page that may be more recent, see RedundantImports in WG2's repo for R7RS-large.

Redundant­Imports

WillClinger
2015-06-05 17:51:18
3history
source

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 xy) (export list car cdr x y) (import (scheme base)) (begin (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 base) (scheme write) (local x) (local y)) (begin (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

different binding in REPL

Chibi

  1. 7

r7rs

okay

bug?

bug?

Chicken

  1. 9.0.1

r7rs

okay

warned

okay

Foment

  1. 4 (debug)

r7rs

bug?

bug?

bug?

Gauche

  1. 9.4

r7rs

okay

accepted

okay

Kawa

  1. 0

r7rs

okay

rejected

okay

Larceny

  1. 98

r7rs

okay

rejected

okay

Petit Larceny

  1. 98

r7rs

okay

rejected

okay

Sagittarius

  1. 6.4

r7rs

okay

rejected

rejected

Larceny

  1. 98

r6rs

okay

rejected

n/a

Petit Larceny

  1. 98

r6rs

okay

rejected

n/a

Petite Chez

  1. 4

r6rs

okay

rejected

n/a

Racket

  1. 1.1

r6rs

okay

rejected ?

n/a

Sagittarius

  1. 6.4

r6rs

okay

rejected

n/a

Vicare

  1. 3d7

r6rs

okay

rejected

n/a

The R6RS effectively forbids REPLs.

In some cases, indicated by "bug?", the observed behavior appears to indicate a bug that's unrelated to the issue tested here.

See also the list of real and potential conflicts between SRFIs.