core.clj文件的目的是什么? [英] What is the purpose of core.clj file?
问题描述
我刚刚开始clojure,并有一个非常基本的问题关于 core.clj。
I am just started on clojure and have a very basic question about core.clj.
有什么约定?什么代码应该去那里? Public API?
What is a convention about it? What code should go there? Public API?
在创建项目时由 leiningen 生成。
我已经查看了一些库的源代码,并且这个文件也存在(每个包。)
It is generated by leiningen when creating a project. I have looked into source code of some libraries and this file is also present there (per package?).
感谢
推荐答案
它没有定义的意义,但在应用程序中,它通常是你会找到入口点, main -
函数。对于库, foo.core
通常是用户导入以获得您的主要功能的命名空间。
There's no defined meaning for it, but in an application it's often where you'll find the entry point, the main-
function. For libraries, foo.core
is often the namespace users will import to get your main functionality.
t 有这样做,但它是一个半可预测的地方,具有任何你正在写的中心位 - 即使你的实际逻辑和算法代码在别的地方。
You don't have to do it that way, but it's a semi-predictable place to have the 'central bit' of whatever it is you're writing - even if your actual logic and algorithmic code is somewhere else.
这篇关于core.clj文件的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!