将其他文件包含到project.clj中
是否可以将其他文件包含(导入?)到 clojure 项目的 project.clj 中? (特别是莱宁根)。
例如,我们有:
(defproject sample-clojure-cloudbees "1.0.0-SNAPSHOT"
:description "Sample clojure application - clojure 1.3 !"
:some-key "some value")
在除project.clj 之外的文件中定义更多诸如:some-key 之类的东西会很好。
Is it possible to include (import?) other files into the project.clj for a clojure project? (leiningen, specifically).
eg we have:
(defproject sample-clojure-cloudbees "1.0.0-SNAPSHOT"
:description "Sample clojure application - clojure 1.3 !"
:some-key "some value")
It would be nice to define more things like :some-key in files other than project.clj.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
defproject 没有理由必须是顶级形式。您可以通过构建参数列表来构造对 defproject 的调用。唯一的问题是 defproject 是一个宏,因此简单的“应用”功能没有帮助。
请注意,这是读取文件,然后评估该文件中的元素。确保您知道文件来自哪里!
There's no reason that defproject has to be a top-level form. You can construct a call to defproject by building up an argument list. The only catch is that defproject is a macro, so the straightforward "apply" function won't help.
Note that this is reading a file, then evaluating the elements from that file. Be sure you know where the file is coming from!