From a37322c9d9b323e9b564dcae973ca86499479d90 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Sun, 20 Jan 2013 16:06:53 +0000 Subject: [PATCH] LENGTH function works for arrays (vectors) --- ecmalisp.lisp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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)) -- 1.7.10.4