Skip to content
Browse files

Merge pull request #116 from jasom/list-star-fix

Chamge list* pattern to match how the fn works
  • Loading branch information...
2 parents 6f7d4d0 + 010ca46 commit 373b245b928c1a5cce91a6cb5bfe5dd77eb36195 @m2ym committed
Showing with 4 additions and 2 deletions.
  1. +1 −1 src/pattern.lisp
  2. +3 −1 test/suite.lisp
View
2 src/pattern.lisp
@@ -379,7 +379,7 @@ Examples:
(defpattern list* (arg &rest args)
(if (null args)
- `(and ,arg (type list))
+ `,arg
`(cons ,arg (list* ,@args))))
(defpattern satisfies (predicate-name)
View
4 test/suite.lisp
@@ -165,7 +165,9 @@
(is-match '() (list* _))
(is-match '(1 2 3) (list* 1 2 (list 3)))
(is-match '(1 2 3) (list* _))
- (is-not-match 5 (list* _))
+ (is-match 5 (list* _))
+ (is-match '(1 2 . 3) (list* _ _ _))
+ (is-not-match '(1 2 . 3) (list* _ _ _ _))
;; alist
(is-match '((1 . 2) (2 . 3) (3 . 4)) (alist (3 . 4) (1 . 2)))
;; plist

0 comments on commit 373b245

Please sign in to comment.
Something went wrong with that request. Please try again.