From: David Bakhash
Subject: proper subtype?
Date: 
Message-ID: <m3puaghy0m.fsf@alum.mit.edu>
Hi,

Unlike the function SUBTYPEP in CL, is there a way of finding out if
TYPE-1 is a *proper* subtype of TYPE-2?

thanks,
dave
From: Kent M Pitman
Subject: Re: proper subtype?
Date: 
Message-ID: <sfwg0bbn5h0.fsf@world.std.com>
David Bakhash <·····@alum.mit.edu> writes:

> Unlike the function SUBTYPEP in CL, is there a way of finding out if
> TYPE-1 is a *proper* subtype of TYPE-2?

Probably something like this would work.  I didn't test them.
(Please let me know if you see a problem in them.)

(defun type-equal-p (x y)
  (multiple-value-bind (x-subtype-of-y xy-known-p)
      (subtypep x y)
    (multiple-value-bind (y-subtype-of-x yx-known-p)
        (subtypep y x)
      (values (and x-subtype-of-y y-subtype-of-x)
              (and xy-known-p yx-known-p)))))

(defun proper-subtype-p (x y)
  (multiple-value-bind (x-subtype-of-y xy-known-p)
      (subtypep x y)
    (multiple-value-bind (y-subtype-of-x yx-known-p)
        (subtypep y x)
      (values (and x-subtype-of-y (not y-subtype-of-x))
              (and xy-known-p yx-known-p)))))