From a35dd8463cdc4d8fa2649ca22a1eceaa68a1078f Mon Sep 17 00:00:00 2001 From: zeptometer Date: Wed, 6 Aug 2014 21:47:21 +0900 Subject: [PATCH] in syntax-rules, literals is prior to underscore --- piclib/scheme/base.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/piclib/scheme/base.scm b/piclib/scheme/base.scm index b9d7ffb5..02f3c9e2 100644 --- a/piclib/scheme/base.scm +++ b/piclib/scheme/base.scm @@ -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)