3.3 Using type-specific operations
;; The type simple-vector is equivalent to the type ;; (simple-array t (*)). (declare (type simple-vector v))The following declarations, however, contain insufficient information:(declare (type (simple-array t (* *)) a)) (declare (type (simple-array (unsigned-byte 8) (*)) v8))
;; The type vector does not imply the type simple-array. (declare (type (vector (unsigned-byte 8)) v))If all arrays in a piece of code are of a certain type, it might be simpler to use a;; The element-type is not known. (declare (type (simple-array * (2 3)) a))
;; The number of dimensions is not specified. (declare (type (simple-array t) a1))
type-reduce
declaration to restrict the types of all arrays. If an application uses only simple one-, two-, or three-dimensional arrays of typet
, for example, the following declaration could be used:(declare (type-reduce (array * (*)) simple-vector) (type-reduce (array * (* *)) (simple-array t (* *))) (type-reduce (array * (* * *)) (simple-array t (* * *))))
Generated with Harlequin WebMaker