【发布时间】:2018-03-03 08:23:32
【问题描述】:
我遇到了以下sn-p的代码:
(defstructure object
"An object is anything that occupies space. Some objects are 'alive'."
(name "?") ; Used to print the object on the map
(alive? nil) ; Is the object alive?
(loc (@ 1 1)) ; The square that the object is in
(bump nil) ; Has the object bumped into something?
(size 0.5) ; Size of object as proportion of loc
(color 'black) ; Some objects have a color
(shape 'rectangle) ; Some objects have a shape
(sound nil) ; Some objects create a sound
(contents '()) ; Some objects contain others
(max-contents 0.4) ; How much (total size) can fit inside?
(container nil) ; Some objects are contained by another
(heading (@ 1 0)) ; Direction object is facing as unit vector
)
我不确定这里的@ 表示什么。我已经搜索了其余的代码,看看它是否被定义为一个函数,但还没有找到任何东西。我的问题是,“@”是一些常用 lisp 的常用实现的一部分,还是这段代码是特定的?谢谢。
文件链接: https://github.com/aimacode/aima-lisp/blob/master/agents/environments/grid-env.lisp
【问题讨论】:
标签: common-lisp