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

Esoteric DEFTYPE :type property

Here's a very esoteric property -- I hesiate to call it a bug -- of

>(defstruct (quux (:type list) :named) x y)

>(deftype quux () '(satisfies quux-p))

>(typep (make-quux) 'quux)

Steele isn't clear on what should happen, but Lucid 2.2 returns T, which
seems to be a more useful value. 

The reason for this behavior is that TYPEP tests first to see if (make-quux)
is a structure, and tests for a deftype-definition only if it's not. One
fix is to reverse the two cond clauses at the end of the definition
of type in predlib.lsp, if anybody really cares.