Essentially I'd say that you'll have to use (typep var 'string-type)
, but there is no such type as string as far as I known.
Determining a type via type-of results in
(type-of "rowrowrowyourboat")
> (SIMPLE-ARRAY CHARACTER (17))
which is hardy a type I could look for in a generic way as looking for just SIMPLE-ARRAY
wouldn't do any good:
(typep "rowrowrowyourboat" 'simple-array)
> t
(typep (make-array 1) 'simple-array)
> t
And using a intuitive the hack of dynamically determining the type of an example string doesn't do any good either as they will not be of the same length (most of the time)
(typep "rowrowrowyourboat" (type-of "string"))
> nil
So I wonder what is the canonical way to check whether a given variable is of type string?