X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fstring.lisp;h=8bead9b5573383120cf35282e09b0d0041052152;hb=f5ffe129c45d75d9f360d02d9b8823907b163347;hp=9c547efaebcdeb07abc911b3758e67088c2fad2a;hpb=8ae132f29fe3732e97c2eec74bd1eb65ecdf35fc;p=jscl.git diff --git a/src/string.lisp b/src/string.lisp index 9c547ef..8bead9b 100644 --- a/src/string.lisp +++ b/src/string.lisp @@ -19,7 +19,9 @@ (t (char-to-string x)))) (defun string= (s1 s2) - (let ((n (length s1))) + (let* ((s1 (string s1)) + (s2 (string s2)) + (n (length s1))) (when (= (length s2) n) (dotimes (i n t) (unless (char= (char s1 i) (char s2 i)) @@ -36,6 +38,9 @@ (when (and (= i (1- len-1)) (> len-2 len-1)) (return-from string< (1+ i)))))))) +(defun stringp (s) + (stringp s)) + (define-setf-expander char (string index) (let ((g!string (gensym)) (g!index (gensym))