Testing strings/floats/ints

  • Thread starter Thread starter shanesparks
  • Start date Start date
S

shanesparks

Does anyone know how to test for the validity
of a string, float or int without producing an error
if not a valid test. We can test for validity of a list
with listp, but when we try to test with something
like strcat for a string it will crash if fed a real.

Maybe there is something easy, but I have not found it
yet.

Shane
 
It's tempting to write code for you, but generally speaking, you should know the data type you are dealing with and use it accordingly rather than relying on a convert all function like vl-princ-to-string.

A starter might be to look / read up on the lisp functions -- type, itoa, rtos, vl-princ-to-string, vl-symbol-name ...

Cheers.
 
Back
Top