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

typep of array

The line that is commented out in the enclosed code fragment seems like
a good example of a deficiency in the Common Lisp type system.  There is
no way in a single typecase to make this discrimination, i.e. to have
a clause that handles all arrays whose elements are guaranteed to be
integers.  One has to have a typecase clause for plain array, inside
of which are conditions using array-element-type and subtypep, which
is ugly.

(defun write-binary-object (object type binary-output-stream)
  (typecase object
;   ((array integer) (write-binary-object-packed-array object binary-output-stream))
    (array (write-binary-object-array object binary-output-stream))