two functions; which one is in the lisp way?
Greetings Lispers! I needed a function which checks if a string has a string integer representation. I did two version for it: (defun string-integer-p (str) (when (or (char= #\- (char str 0)) (char= #\+ (char str 0))) (setq str (subseq str 1))) (= (length str) (count-if #'digit-char-p str))) (defun string-integer-p (str) (handler-case (progn (parse-integer str) t) (error () nil))) And now I'm just curious :), which one is in the lisp way? When compiled in LW6 their execution time is the same, but the last one takes less memory based on (time ...). Which one to use? Or maybe there is a standard function in the standard that I've missed? Best, Art