Open LiberalArtist opened 2 years ago
It looks like https://github.com/racket/racket/commit/163b9dda74a60bad759fefa8bd46a61441f8b926 might be a simple way to fix this.
I think this incorrectly-accepted program illustrates the same bug, but I am not sure that (#%declare #:require=define)
would be enough to fix it:
#!r6rs
(library (conflict)
(export let)
(import (for (only (rnrs base) define-syntax lambda) run)
(for (rnrs base) expand) ; should require (except (rnrs base) let)
(for (rnrs syntax-case) expand))
(define-syntax let
(lambda (stx)
(syntax-case stx ()
[(_ id rhs body0 body ...)
#'((lambda (id) body0 body ...) rhs)]))))
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):