Skip to main content
1 of 4
gigiair
  • 2.3k
  • 1
  • 11
  • 15

the read function can be applied to a string and then the numberp function tests whether the read object represents a number or not, integer, or float.

(mapcar (lambda(x)(numberp(read x))) (list "123" "1.23" "sqrt(123)" "12e-3" "12ab3")) 

=>

 (t t nil t nil) 
gigiair
  • 2.3k
  • 1
  • 11
  • 15