2
(defspel game-action (command subj obj place &rest rest)
`(defspel ,command (subject object)
`(cond ((and (eq *location* ',',place)
(eq ',subject ',',subj)
(eq ',object ',',obj)
(have ',',subj))
,@',rest)
(t '(i cant ,',command like that.)))))
從http://www.lisperati.com/actions.html爲「宏定義宏」轉換的宏之一那的代碼。我似乎無法將其恰當地轉換爲方案。有人能向我解釋在Scheme中創建這種類似的東西的過程嗎?PLT方案:在「鑄造SPELs在LISP」
非常感謝!^_ ^ – 2010-01-12 04:16:04