projects
/
jscl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e20b874
)
LENGTH function works for arrays (vectors)
author
David Vázquez
<davazp@gmail.com>
Sun, 20 Jan 2013 16:06:53 +0000
(16:06 +0000)
committer
David Vázquez
<davazp@gmail.com>
Sun, 20 Jan 2013 16:06:53 +0000
(16:06 +0000)
ecmalisp.lisp
patch
|
blob
|
history
diff --git
a/ecmalisp.lisp
b/ecmalisp.lisp
index
80f2344
..
03f2988
100644
(file)
--- 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))