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

question about subtypep



    CLTL is pretty vague about what subtypep does.  My intpretation
(based on intensive meditation and reading of scripture) is that
SUBTYPEP returns information about the actual subtype relations in
your implementation.  Discrepencies will exist most often when an
implementation decides to fold potentially distinct types together.
For example, if all arrays are adjustable and have fill-pointers, then
SIMPLE-ARRAY is indentical to ARRAY, and therefore 
(SUBTYPEP 'ARRAY 'SIMPLE-ARRAY) is true.

    Note there are some possible users of SUBTYPEP that would prefer
answers to be based on some hypothetical maximally restrictive type
system.  The main example is a compiler which does compile-time type
checking when possible.  Although (THE SHORT-FLOAT 1F0) is quite legal
in an implementation in which SHORT-FLOAT and SINGLE-FLOAT are
identical, it would be reasonable for the compiler to give a warning
anyway.  Applications that care about this sort of thing will have to
use a variant version of subtypep that is distinct from the real
SUBTYPEP.

  Rob