【发布时间】:2016-01-29 16:27:25
【问题描述】:
我正在尝试在 IntelliJ\Cursive 中运行一个简短的 Clojure 程序。 我的程序包括两个文件:
project.clj:
(defproject try3 "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]]
:main try3.core)
和:
core.clj:
(ns try3.core)
(defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
(defn -main [] (println "hi"))
我希望当我运行项目时,-main 函数会自动运行。我该怎么做才能做到这一点?
【问题讨论】:
-
你检查过this page吗?你的代码看起来不错。启动 leiningen 和
lein run你的项目。
标签: intellij-idea clojure cursive