Skip to content

SUBTYPE on AND types of two classes

SUBTYPEP has the wrong idea about AND types of two CLASS (or conditions):

(defclass aaa ()
  ())

(defclass bbb ()
  ())

(defclass ccc (aaa bbb)
  ())

(subtypep '(and aaa bbb) nil)
=> T
   T

The expected behaviour is:

(subtypep '(and aaa bbb) nil)
=> NIL
   NIL

or

(subtypep '(and aaa bbb) nil)
=> NIL
   T

Other implementations are split on which of the two is correct.

Provide details regarding ECL version (or preferably commit), operating system and if revelant the build options and versions of the build tools.

     VERSION "20.4.24"
      VCS-ID "UNKNOWN"
          OS "Linux"
  OS-VERSION "5.10.46-5rodete1-amd64"
MACHINE-TYPE "x86_64"
    FEATURES (:CLOSER-MOP :SWANK :SERVE-EVENT :QUICKLISP :ASDF-PACKAGE-SYSTEM
              :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX :NON-BASE-CHARS-EXIST-P
              :ASDF-UNICODE :WALKER :CDR-1 :CDR-5 :LINUX :FORMATTER :CDR-7
              :ECL-WEAK-HASH :LITTLE-ENDIAN :ECL-READ-WRITE-LOCK :LONG-LONG
              :UINT64-T :UINT32-T :UINT16-T :COMPLEX-FLOAT :LONG-FLOAT :UNICODE
              :DFFI :CLOS-STREAMS :CMU-FORMAT :UNIX :ECL-PDE :DLOPEN :CLOS
              :THREADS :BOEHM-GC :ANSI-CL :COMMON-LISP
              :FLOATING-POINT-EXCEPTIONS :IEEE-FLOATING-POINT
              :PACKAGE-LOCAL-NICKNAMES :CDR-14 :PREFIXED-API :FFI :X86_64
              :COMMON :ECL)