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

CompilerBug - TYPEP



In Rel 6.1, defining the function

(defun is-array (sexp)
  (equal (typep sexp) :array))

then when is array is compliled

(is-array "foo") => T

but when is-array is interpreted

(is-array "foo") => NIL

The compiler is apparently optimizing
  (equal (typep X) Y) => (typep X Y)
  but there are cases in which they are not equivalent, particularly when
we are trying to distinguish between an instance of Y and an instance of X,
where Y is a subtype of X.  Like arrays and strings.

The optimization is not consistant.  In other code where X and Y were
flavors, the compiled code has not been incorrectly optimized.

David Throop
-------