Does Clojure have an equivalent to Python's if __name__==“__main__”? [duplicate]

断了今生、忘了曾经 提交于 2019-12-25 18:07:53

问题


Possible Duplicate:
What is the clojure equivalent of the Python idiom “if name == 'main'”?

I would use -main, but it only runs in compiled mode, not interpreted mode.

I would use (if (.isAbsolute (java.io.File. *file*)) (main *command-line-args*)), but that runs during any (load)ing of scripts.


回答1:


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.



来源:https://stackoverflow.com/questions/5224548/does-clojure-have-an-equivalent-to-pythons-if-name-main

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!