[parenscript-devel] The ps-macro for length
Parenscript ships with a helper macro like this: (defpsmacro length (a) `(.size ,a)) But there's no "size" function for arrays or strings... in fact, is there a "size" function in JS? For most things, it seems like one would want: (defpsmacro length (a) `(@ ,a length)) What am I missing? Dan
Daniel Gackle wrote:
Parenscript ships with a helper macro like this:
(defpsmacro length (a) `(.size ,a))
But there's no "size" function for arrays or strings... in fact, is there a "size" function in JS?
.size() is a method from the Prototype library. That probably mixed up whoever put that in there.
For most things, it seems like one would want:
(defpsmacro length (a) `(@ ,a length))
I agree that is more general. I've pushed this fix out to the darcs repos. Cheers, -- Travis
participants (2)
-
Daniel Gackle
-
Travis Cross