mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
Identifiers in patterns should be checked against literals using bound-identifier=?, not free-identifier=?.
This commit is contained in:
parent
cdd5ffa406
commit
e3678edbdc
2 changed files with 10 additions and 1 deletions
|
@ -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))
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Add table
Reference in a new issue