[Previously filed on gitlab.common-lisp.net, but that doesn't seem to have been the right place.]
AFAIK, CL provides no portable way to determine whether a symbol has been deftyped. The only semi-portable way I know to do it is to try passing it to typep and see whether I get an error:
(defun is-type? (x)
(handler-case
(progn (typep nil x) t)
(error () nil)))
This works on SBCL, CCL, ECL, CLASP, Allegro, and LispWorks, but fails on ABCL:
> (typep nil 'garbage)
NIL
It is true that the spec for typep says
The consequences are undefined if the type-specifier is not a type specifier.
but it would be nice if ABCL would signal an error, as other implementations do. Wouldn't it make sense to do this in normalize-type?