I have been unable to find any built-in method of checking if something is a valid type specifier.
Does such a predicate exist?
(I would make one myself, but alas, the consequences of passing something not a type specifier to typep
are undefined. And check-type
has no exceptional situations according to the hyperspec.)
You could use Tomohiro Matsuyama's trivial-types
system (LLGPL), which among other things defines a wrapper around some implementation-specific predicates:
(defun type-specifier-p (type-specifier)
"Returns true if TYPE-SPECIFIER is a valid type specfiier."
(or (documentation type-specifier 'type)
#+sbcl (sb-ext:valid-type-specifier-p type-specifier)
#+openmcl (ccl:type-specifier-p type-specifier)
#+ecl (c::valid-type-specifier type-specifier)))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With