I am trying to print the contents of an Array of rank 2. However, I am getting this error:
- Code: Select all
; At the moment it would just print a bunch of nils, but that's fine for the moment.
CG-USER(15): (defparameter *hi* (make-array '(5 5)))
*HI*
CG-USER(16): *hi*
#2A((NIL NIL NIL NIL NIL)
(NIL NIL NIL NIL NIL)
(NIL NIL NIL NIL NIL)
(NIL NIL NIL NIL NIL)
(NIL NIL NIL NIL NIL))
CG-USER(17): (loop for i across *hi* do (print i))
Error: attempt to take the length of a non-sequence:
#<Array of rank 2 @ #x2122e832>
I know this of course would work if it was just a vector (one-dimension), but does Common Lisp have any method of printing the contents of a multi-dimensional array?
Thanks!

