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

question about subtypep



    Date: Thu, 14 Aug 1986  06:51 EDT
    From: Rob MacLachlan <RAM@C.CS.CMU.EDU>

	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.

They'll have to do more than that.  If the user wrote (THE SHORT-FLOAT 1s0)
it would read as exactly the same Lisp object as (THE SHORT-FLOAT 1f0) in an
implementation where SHORT-FLOAT and SINGLE-FLOAT are identical, so I don't
see how the compiler could distinguish these and give a warning for one but
not for the other.

    My intpretation
    (based on intensive meditation and reading of scripture) is that
    SUBTYPEP returns information about the actual subtype relations in
    your implementation.

I agree.  I think that's the only consistent interpretation.