Permalink
Browse files

(fixes #15) fixed an error between matching.

  • Loading branch information...
1 parent e892168 commit a48a045c159e2bb85c2fcdf52c2274614fac71c2 @fukamachi fukamachi committed Jun 22, 2011
Showing with 9 additions and 1 deletion.
  1. +1 −1 src/compile.lisp
  2. +8 −0 test/match.lisp
View
@@ -51,7 +51,7 @@
for sub-clauses = (nreverse (cdr pair))
collect
`(,constant
- (%match ,(cdr vars) ,sub-clauses)))
+ (%match ,(cdr vars) ,sub-clauses ,else)))
,else))))
(defun compile-match-constructor (vars clauses else)
View
@@ -1,9 +1,12 @@
+(in-package :cl-user)
(defpackage cl-pattern.test
(:use :cl
:cl-test-more
:cl-pattern))
(in-package :cl-pattern.test)
+(plan 22)
+
(is (match 1
(x x))
1
@@ -48,6 +51,11 @@
(_ 'otherwise))
'otherwise
"match otherwise")
+(is (match '(:a :b :c)
+ ((:a :b) t)
+ (_ 'otherwise))
+ 'otherwise
+ "match otherwise")
(is (match ()
((&optional a) a))
nil

0 comments on commit a48a045

Please sign in to comment.