Clojure 的 Python StringIO

发布于 2024-09-26 00:37:45 字数 335 浏览 14 评论 0原文

Clojure 是否有相当于 Python 的 StingIO 的东西?

我正在尝试编写一个类似于 Sweave 和 Clojure 的 Pweave。我目前正在使用临时文件,但我更喜欢使用类似于 StringIO 的文件。

Is there something equivalent to Python's StingIO for Clojure?

I'm trying to write a report generating/literate programming system similar to Sweave and Pweave for Clojure. I'm currently using a temp file, but I'd prefer using something similar to StringIO.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

孤独难免 2024-10-03 00:37:45

with-out-str 非常方便。

(let [foo (with-out-str (println "Hello world!"))] 
   foo)

更多文档此处

with-out-str is pretty handy.

(let [foo (with-out-str (println "Hello world!"))] 
   foo)

More documentation here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文