Commit 293207538296decda806ace7b1e928aa6f1b1e14

Thomas de Grivel 2013-12-10T16:32:19

Allow NIL case in case-char.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/str.lisp b/str.lisp
index b788be8..7f67ed2 100644
--- a/str.lisp
+++ b/str.lisp
@@ -24,9 +24,10 @@
        (cond
 	 ,@(mapcar (lambda (case-decl)
 		     (destructuring-bind (match &rest match-body) case-decl
-		       (if (stringp match)
-			   `((find ,g!char ,match) ,@match-body)
-			   `(,match ,@match-body))))
+		       (typecase match
+			 (string `((find ,g!char ,match) ,@match-body))
+			 (null `((null ,g!char) ,@match-body))
+			 (t `(,match ,@match-body)))))
 		   cases)))))
 
 (defun rope-merge (rope)