in syntax-rules, literals is prior to underscore

This commit is contained in:
zeptometer 2014-08-06 21:47:21 +09:00
parent 4f59e07539
commit a35dd8463c
1 changed files with 2 additions and 2 deletions

View File

@ -410,13 +410,13 @@
(define (compile-match ellipsis literals pattern)
(letrec ((compile-match-base
(lambda (pattern)
(cond ((compare pattern (r '_)) (values #f '()))
((member pattern literals compare)
(cond ((member pattern literals compare)
(values
`(,_if (,_and (,_symbol? expr) (cmp expr (rename ',pattern)))
#f
(exit #f))
'()))
((compare pattern (r '_)) (values #f '()))
((and ellipsis (compare pattern ellipsis))
(values `(,_syntax-error "invalid pattern") '()))
((symbol? pattern)