On Thu, Sep 12, 2002 at 11:35:22AM +0200, Edi Weitz wrote:
> 2. Also, the speed gains are lost if X is fixed, i.e.
I think this is the key.
In
(defun foo (x)
(make-array x :initial-element 0))
x can be a FIXNUM (skating over some complications arising from
implementation-dependent limits) or a list of FIXNUMs; for instance, the
call (FOO '(1 2)) is perfectly valid, and will return a two-dimensionaly
array.
If you will always be making vectors, then either declaring X to be
of type FIXNUM or using MAKE-SEQUENCE with a constant sequence type (of
(VECTOR T), in this case) should give you the speedup you want.
Cheers,
Christophe
--
Jesus College, Cambridge, CB5 8BL +44 1223 510 299
http://www-jcsu.jesus.cam.ac.uk/~csr21/ (defun pling-dollar
(str schar arg) (first (last +))) (make-dispatch-macro-character #\! t)
(set-dispatch-macro-character #\! #\$ #'pling-dollar)