diff --git a/lib/init-7.scm b/lib/init-7.scm index 76d1cb90..fde12935 100644 --- a/lib/init-7.scm +++ b/lib/init-7.scm @@ -728,7 +728,7 @@ _let (list (list v x)) (cond ((identifier? p) - (if (any (lambda (l) (compare p l)) lits) + (if (memq p lits) (list _and (list _compare v (list _rename (list _quote p))) (k vars)) diff --git a/tests/r7rs-tests.scm b/tests/r7rs-tests.scm index fa5fe36b..2585c39d 100644 --- a/tests/r7rs-tests.scm +++ b/tests/r7rs-tests.scm @@ -556,6 +556,15 @@ 42) (test 42 (quux399))) +(let-syntax + ((m (syntax-rules () + ((m x) (let-syntax + ((n (syntax-rules (k) + ((n x) 'bound-identifier=?) + ((n y) 'free-identifier=?)))) + (n z)))))) + (test 'bound-identifier=? (m k))) + (test-end) (test-begin "5 Program structure")