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|
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.