我试图使用标准循环设施来收集结果,但它只返回 nil。为什么是这样?感觉这应该有效:
(defun coll-intersects (bounds mv)
(let ((res (list))
(loop for x from (first bounds) to (+ (first bounds) (third bounds)) do
(loop for y from (second bounds) to (+ (second bounds) (fourth bounds))
if (not (member (cl-byte (aref mapa x y)) mv))
collect (aref mapa x y) into res
))))
Run Code Online (Sandbox Code Playgroud)
但不,我必须这样做:
(defun coll-intersects (bounds mv)
(let ((res (list)))
(loop for x from (first bounds) to (+ (first bounds) (third bounds)) do
(loop for y from (second bounds) to (+ …Run Code Online (Sandbox Code Playgroud)