TouretzkyのLisp
本の144ページにあるサンプルコードは、私の環境でエラーを引き起こします。私の走り方に何か問題がありますか?
(defun price-change (old new)
(let* ((diff (- new old))
(proportion (/ diff old))
(percentage (* proportion 100.0)))
(list ’widgets ’changed ’by percentage
’percent))
)
これがエラーです。文字列「widgets」が評価される理由がわかりません...
Break 5 [7]> (price-change 1.25 1.35)
*** - LET*: variable ’WIDGETS has no value
The following restarts are available:
USE-VALUE :R1 Input a value to be used instead of ’WIDGETS.
STORE-VALUE :R2 Input a new value for ’WIDGETS.
ABORT :R3 Abort debug loop
ABORT :R4 Abort debug loop
ABORT :R5 Abort debug loop
ABORT :R6 Abort debug loop
ABORT :R7 Abort debug loop
ABORT :R8 Abort main loop
環境:Ubuntu 11.10、GNU CLISP 2.49