【发布时间】:2018-12-02 23:39:22
【问题描述】:
我正在尝试调用以下函数:
(defun c:Add ()
(setq a (getint "Enter a number to add 2 to it"))
(setq a (+ a 2))
)
在这个 LOOPER 函数内部:
(defun LOOPER (func)
;repeats 'func' until user enters 'no'
(setq dummy "w")
(while dummy
(func) ;this is obviously the problem
(setq order (getstring "\nContinue? (Y or N):"))
(if (or (= order "N") (= order "n")) (setq dummy nil))
)
)
像这样:
(defun c:Adder ()
(LOOPER (c:Add))
)
如何解决func 在LOOPER 函数中未定义的事实?
【问题讨论】:
-
不会
(LOOPER (c:Add))调用LOOPER并通过调用(c:Add)得到number 一次吗?与将函数c:Add作为参数传递是不一样的。