Detect String
Posted: Sun Jan 15, 2012 2:14 pm
In CLISP, how to detect whether an object is a string or not?
Discuss and learn Lisp programming of all dialects. NOTICE: Site locked. No new users or posts.
http://www.lispforum.com/
Code: Select all
[1]> (stringp "abc")
T
[2]> (stringp 100)
NIL
Code: Select all
(typecase x
(string
(format t "~&X is a string."))
(number
(format t "~&X is a number."))
(t
(format t "~&X is... something.")))