Clojure有一个等价于Python的if __name __ ==" __ main __"? [英] Does Clojure have an equivalent to Python's if __name__=="__main__"?

查看:279
本文介绍了Clojure有一个等价于Python的if __name __ ==" __ main __"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

name ==' main ,那么Python惯用语的clojure等价物是什么? '&rdquo ;?

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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆