Permalink
Browse files

Merge pull request #1 from segv/master

simple change to make a literal string in a pattern work as i expect it to
  • Loading branch information...
2 parents 5887f62 + e4d339e commit 1798bf55731e6cf83618c8b39aa228cb53425aaa @Drakken committed Oct 26, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 match.lisp
View
8 match.lisp
@@ -100,6 +100,12 @@
(def atom-conj (expr atom vars)
(cond ([atom is-wildcard] (new-conj))
((not atom) (new-conj nil (list `(not ,expr))))
+ ((find atom vars) (new-conj nil (list `[,expr eql ,atom])))
+ ([atom is-literal]
+ (typecase atom
+ (number (new-conj nil (list `[,expr = ,atom])))
+ (string (new-conj nil (list `[,expr string= ,atom])))
+ (t (new-conj nil (list `[,expr eql ,atom])))))
([[atom is-literal]
or (find atom vars)] (new-conj nil (list `[,expr eql ,atom])))
(t (new-conj (list atom) (list `(setft ,atom ,expr))))))
@@ -494,4 +500,4 @@
(t `(not (and ,@(nreverse tests)))))))
(setf (conj-tests not-conj) (list not-test)))))
not-conj))
-|#
+|#

0 comments on commit 1798bf5

Please sign in to comment.