欢迎!有关如何使用本网站的信息,请参阅 关于 页面。
我认为添加一个宏,将标准输出重定向到 *err* 将很有用。
*err*
(with-err-out [& body] `(binding [*out* *err*] ~@body))
相反意见:(with-err-out (do-stuff)) 并没有比 (binding [*out* *err*] (do-stuff)) 更短或更易读。
(with-err-out (do-stuff))
(binding [*out* *err*] (do-stuff))