From: David Vázquez Date: Sun, 20 Jan 2013 16:06:53 +0000 (+0000) Subject: LENGTH function works for arrays (vectors) X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=a37322c9d9b323e9b564dcae973ca86499479d90;p=jscl.git LENGTH function works for arrays (vectors) --- diff --git a/ecmalisp.lisp b/ecmalisp.lisp index 80f2344..03f2988 100644 --- a/ecmalisp.lisp +++ b/ecmalisp.lisp @@ -285,9 +285,13 @@ l)) (defun length (seq) - (if (stringp seq) - (string-length seq) - (list-length seq))) + (cond + ((stringp seq) + (string-length seq)) + ((arrayp seq) + (get "length" seq)) + ((listp seq) + (list-length seq)))) (defun concat-two (s1 s2) (concat-two s1 s2))