(defparameter *objects* '(whiskey bucket frog chain))
(defparameter *object-locations* '((whiskey living-room)
(bucket living-room)
(chain garden)
(frog garden)))
(defun objects-at (loc objs obj-locs)
(labels ((at-loc-p (obj)
(eq (cadr (assoc obj obj-locs)) loc)))
(remove-if-not #'at-loc-p objs)))
(objects-at 'living-room *objects* *object-locations*)
(WHISKEY BUCKET)
在 REPL 中返回。
是如何obj
进入的at-loc-p
?的任何参数objects-at
都没有命名obj
。