in syntax-rules, literals is prior to underscore
This commit is contained in:
parent
4f59e07539
commit
a35dd8463c
piclib/scheme
|
@ -410,13 +410,13 @@
|
||||||
(define (compile-match ellipsis literals pattern)
|
(define (compile-match ellipsis literals pattern)
|
||||||
(letrec ((compile-match-base
|
(letrec ((compile-match-base
|
||||||
(lambda (pattern)
|
(lambda (pattern)
|
||||||
(cond ((compare pattern (r '_)) (values #f '()))
|
(cond ((member pattern literals compare)
|
||||||
((member pattern literals compare)
|
|
||||||
(values
|
(values
|
||||||
`(,_if (,_and (,_symbol? expr) (cmp expr (rename ',pattern)))
|
`(,_if (,_and (,_symbol? expr) (cmp expr (rename ',pattern)))
|
||||||
#f
|
#f
|
||||||
(exit #f))
|
(exit #f))
|
||||||
'()))
|
'()))
|
||||||
|
((compare pattern (r '_)) (values #f '()))
|
||||||
((and ellipsis (compare pattern ellipsis))
|
((and ellipsis (compare pattern ellipsis))
|
||||||
(values `(,_syntax-error "invalid pattern") '()))
|
(values `(,_syntax-error "invalid pattern") '()))
|
||||||
((symbol? pattern)
|
((symbol? pattern)
|
||||||
|
|
Loading…
Reference in New Issue