[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Before we start debating proposals to improve TYPE-OF, we should
probably try to figure out what we really want to accomplish. Then we
will have some goals against which to measure the various proposals.
Given that the Common Lisp type system is a lattice and not a simple
tree, TYPE-OF (originally known as "one-argument TYPEP") was considered
to be of very dubious value, and was almost dropped. It was kept in the
language for only one purpose: to provide users with a quick and dirty
way to examine various objects interactively to see what they are. For
this purpose, the current definition is exactly right: each
implementation should provide as detailed a description as it can manage
conveniently. This is non-portable, but given the purpose of this
function, portability is less valuable than getting as much information
to the user as possible.
CLTL (page 52-53) basically says that TYPE-OF is not meant to be used in
code, except in a few odd situations that are adequately handled by the
I sounds to me like Ida and Masinter have in mind some use of TYPE-OF
within programs, and that such use is not adequately covered by TYPEP
and TYPE-CASE. It seems to me that the best way to make progress is to
first spell out this problem or problems, then decide whether TYPE-OF is
the right way to solve the problem (as opposed to inventing some new
form), and finally to think about how to change the definition of
TYPE-OF. If these problems arise in the context of CommonLoops, then
maybe CLASS-OF is the right form to use.