[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

missing function: typep-type-p



It is an error if the "typep" and "subtypep" functions are passed
something other than a valid type specifier.  The set of valid type
specifiers is extensible by defstruct (and possibly by some proposed
active object extensions).  However, there appears to be no way to
determine if an arbitrary expression is a valid second argument to
typep (or declaration type, or first argument to the "the" special
form).  Sometimes one might need to know -- for instance, to determine
if a "foo" defstruct has ever been defined.  I can think of no
non-implementation-dependent way to find out.  By the way, typep is not
required to signal an error if passed an invalid type specifier, so it
might return t, or nil, or whatever.

I suggest a new predicate with an ugly name:

	typep-type-p expr				[Function]

	The expr can be anything at all, and this predicate is true
	iff expr is a valid type specifier in the current Lisp world.