我是Lisp的新手,我想将时间输出打印到文件(/tmp/foo.txt)中,所以我定义了一个关于时间的包装函数,如下所示:
(defun my-time(form)
(lisp::with-open-file (*trace-output* "/tmp/foo.txt"
:direction :output
:if-exists :append
:if-does-not-exist :create)
(time(form))))
(defun test(n)
(dotimes (i n) (format t "this is test ~a.~&" i)))
Run Code Online (Sandbox Code Playgroud)
但是,当我运行时(我的时间(测试2)),出现以下错误: 错误:使用arguments()调用未定义的函数FORM.
我做这个测试时没关系:(时间(测试2))
有人能给我一些线索吗?