我正在自学Common Lisp。我一直在看康威生命游戏的一个例子,但有一部分语法我不理解。
完整代码可以在这里找到。我特别困扰的部分如下:
(defstruct (world (:constructor %make-world))
current
next)
(defun make-world (width height)
(flet ((make-plane (width height)
(make-array (list width height)
:element-type 'bit
:initial-element 0)))
(%make-world
:current (make-plane width height)
:next (make-plane width height))))
我想知道%make-world中的百分号的意义是什么?其次,为什么构造函数指定了两个不同的名称?(make-world和%make-world)我以前见过这种语法的使用,但名称总是相同的。看起来有一些更深层次的功能,但是我还没有掌握。