You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An identifier can be imported with the same local name from two or more libraries or for two levels from the same library only if the binding exported by each library is the same (i.e., the binding is defined in one library, and it arrives through the imports only by exporting and re-exporting). Otherwise, no identifier can be imported multiple times, defined multiple times, or both defined and imported.
Racket's R6RS language currently fails to enforce this requirement.
Consider the following library, saved in a file bug.sls:
Racket allows this library, but it is rejected (at least) by Chez Scheme (both upstream and Racket's variant):
philip@bastet:~/code/tmp$ racket bug.sls
philip@bastet:~/code/tmp$ scheme bug.sls
Chez Scheme Version 9.5.8
Copyright 1984-2022 Cisco Systems, Inc.
Exception: multiple definitions for + in body (library (bug) (export) (import (rnrs base)) (define + (quote plus))) at line 2, char 1 of bug.sls
philip@bastet:~/code/tmp$ guix shell --pure --container chez-scheme-for-racket -- scheme bug.sls
Chez Scheme Version 9.5.7.6
Copyright 1984-2021 Cisco Systems, Inc.
Exception: multiple definitions for + in body (library (bug) (export) (import (rnrs base)) (define + (quote plus))) at line 2, char 1 of bug.sls
The text was updated successfully, but these errors were encountered:
LiberalArtist
changed the title
Identifier incorrectly allowed to be "both imported and defined"
Identifier incorrectly allowed to be "both defined and imported"
May 22, 2022
R6RS §7.1 says:
Racket's R6RS language currently fails to enforce this requirement.
Consider the following library, saved in a file
bug.sls
:Racket allows this library, but it is rejected (at least) by Chez Scheme (both upstream and Racket's variant):
The text was updated successfully, but these errors were encountered: