Clojure有一个等价于Python的if __name __ ==" __ main __"? [英] Does Clojure have an equivalent to Python's if __name__=="__main__"?
问题描述
Possible Duplicate:
What is the clojure equivalent of the Python idiom “if name == 'main'”?
我会使用 -main
I would use -main
, but it only runs in compiled mode, not interpreted mode.
我会使用(if(.isAbsolute() java.io.File。* file *))(main * command-line-args *))
,但在任何(load)
I would use (if (.isAbsolute (java.io.File. *file*)) (main *command-line-args*))
, but that runs during any (load)
ing of scripts.
推荐答案
复制,什么是clojure等价的Python的成语?是什么?我想我应该投票把这个问题作为一个重复,但我不知道如何;有人随意编辑或通知我正确的技术。
Duplicate of What is the clojure equivalent of the Python idiom "if __name__ == '__main__'"?. I guess I'm supposed to "vote to close this question as a duplicate" but I can't figure out how; someone feel free to edit this or inform me of the proper technique.
这篇关于Clojure有一个等价于Python的if __name __ ==" __ main __"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!