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-01 20:26:36
1created pagehistory
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 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

  1. 7

r7rs

okay

?

?

Chicken

  1. 9.0.1

r7rs

?

?

?

Foment

  1. 4 (debug)

r7rs

?

?

?

Gauche

  1. 9.4

r7rs

?

?

?

Kawa

  1. 0

r7rs

?

?

?

Larceny

  1. 98

r7rs

okay

rejected

okay

Petit Larceny

  1. 98

r7rs

okay

rejected

okay

Sagittarius

  1. 6.4

r7rs

?

?

?

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.

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