在List中vector其实本质上就是一个一维的数组。所以数组函数也是可以用于vector的
简单代码如下,构造一个List数组,然后遍历之。
(defvar alls)
(setf alls (vector '(10 12 14 20 22 26) '(03 05 06 07 11 12)))
(loop for i from 1 to (array-total-size alls)
do(loop for h from 1 to (list-length (svref alls (1- i)))
do(format t "~d," (nth (1- h) (svref alls (1- i))))
)
(format t "~%")
)
效果如图:简单代码如下,构造一个List数组,然后遍历之。
(defvar alls)
(setf alls (vector '(10 12 14 20 22 26) '(03 05 06 07 11 12)))
(loop for i from 1 to (array-total-size alls)
do(loop for h from 1 to (list-length (svref alls (1- i)))
do(format t "~d," (nth (1- h) (svref alls (1- i))))
)
(format t "~%")
)