(defmethod update :before ((a AGENT) (e UPDATE))
(when (null (timestamps a))
(push 0 (pls a))
(push 0 (fitnesses a)))
(push (timestamp e) (timestamps a))
(push (price e) (revalprices a))
(preprocess a e)
(format T ":BEFORE completed for agent ̃A and event ̃A ̃%" a e))
上述方法從一本書來了,我想打聽一下是什麼update
和:before
之間的差異。根據我對CLOS Lisp中定義方法的理解,update
是該方法的名稱,但:before
的作用是什麼?Lisp的防守方法結構
最後最後一行做了什麼? (format T ":BEFORE completed for agent ̃A and event ̃A ̃%" a e))