Ferreira wrote:Is there any "easy way" to get ((1 2) (3 4)) from #((1 2) (3 4))?
Actually, #((1 2) (3 4)) is a vector of two elements, both of which are lists, so you can:
[1]> #((1 2)(3 4))
#((1 2) (3 4))
[2]> (coerce #((1 2)(3 4)) 'list)
((1 2) (3 4))
Real two dimensional arrays (with read syntax like #2A((1 2)(3 4)) ) are not sequences, and so as far as I know there is no built in way to transform them into nested list. But it is easy enough with a simple nested loop, like for example:
(defun to-list (2d-array)
(loop for i from 0 below (array-dimension 2d-array 0)
collect (loop for j from 0 below (array-dimension 2d-array 1)
collect (aref 2d-array i j))))
CL-USER> (to-list #2A((1 2)(3 4)))
((1 2) (3 4))