Common lisp 如何禁用读卡器宏?

Common lisp 如何禁用读卡器宏?,common-lisp,reader-macro,Common Lisp,Reader Macro,我使用了local time的reader宏,直到我意识到我不需要它(想读回日期吗?只需使用format或local time:format datestring,它就不会输出@..) 但是,它与使用ps:@ 冒号后的终止字符非法:#@ 我可以在不重新启动图像的情况下禁用读卡器宏吗 它的作用是 (defun enable-read-macros () "Enables the local-time reader macros for literal timestamps and univer

我使用了local time的reader宏,直到我意识到我不需要它(想读回日期吗?只需使用format或local time:format datestring,它就不会输出
@
..)

但是,它与使用
ps:@

冒号后的终止字符非法:#@

我可以在不重新启动图像的情况下禁用读卡器宏吗

它的作用是

(defun enable-read-macros ()
  "Enables the local-time reader macros for literal timestamps and universal time."
  (set-macro-character #\@ '%read-timestring)
  (set-dispatch-macro-character #\# #\@ '%read-universal-time)
  (values))

我没有在Parenscript一侧看到reader宏。

也许您可以尝试使用类似的方法将更改还原到当前可读表,这样可以获得标准可读表,并将当前可读表的条目“还原”到标准可读表

(let ((rt (copy-readtable nil)))
  (multiple-value-bind (function non-terminating-p)
      (get-macro-character #\@ rt)
    (set-macro-character #\@ function non-terminating-p))
  (set-dispatch-macro-character #\# #\@ (get-dispatch-macro-character #\# #\@ rt)))

非常粗糙,从这里可以学到很多:)它不起作用,错误仍然存在
get宏字符
返回
NIL-NIL
。NIL是
(set | get)-[dispatch-]宏字符
中标准可重设的有效指示符,因此无需使用
(copy readtable NIL)
并将其绑定到
rt
。但除此之外,它在我的机器上工作,所以OP可能应该强制重新加载parenscript系统(例如(asdf:load:parenscript:force t))mmh
asdf:load
未定义,尝试使用
load system
:force
抛出编译文件错误,如果没有它,它将运行,但这还不够。SBCL 1.4.5,asdf 3.3.1。