[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
typep of array
- To: Steele%CMU-CS-C@SU-DSN
- Subject: typep of array
- From: David A. Moon <Moon%SCRC-TENEX%MIT-MC@SU-DSN>
- Date: Fri, 03 Jun 1983 06:13:00 -0000
- Cc: Common-Lisp@SU-AI
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))
...))