如何将 Clojure REPL 的内容转储到文件中? [英] How can you dump contents of Clojure REPL to a file?
问题描述
所以我一直在编写 Clojure 教程,到目前为止它非常有趣.不幸的是,每次我关闭 REPL 时,我都会丢失我在上一个会话中创建的所有 defn
和 def
.
So I have been working on a Clojure tutorial and it's pretty fun so far. Unfortunately, every time I close my REPL out, I lose all of the defn
and def
that I created in the previous session.
那么,为了将来节省时间,是否可以让 Clojure REPL 将我输入的所有内容保存到文件中,以便我可以挖掘出我需要的内容以备将来使用?
So, to save time in the future, is it possible to have the Clojure REPL save everything I've typed to a file so I can dig out what I need for future uses?
推荐答案
我认为大多数人的工作方式是使用他们的 IDE 将代码片段发送到 REPL,而不是在 REPL 中进行大量的直接黑客攻击.这样您就可以更好地了解程序的当前状态.
I think most people work by using their IDE to send fragments of code to the REPL, rather than doing a lot of direct hacking in the REPL. This way you have a better idea of the current state of the program.
这篇关于如何将 Clojure REPL 的内容转储到文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!