问题描述
我对Clojure和Leiningen都很新。我已经安装Clojure在Windows上 C:\clojure-1.5.1
和leiningen-win-installer beta1在 C:\.lein\\ \\ bin
。
I am very new to both Clojure and Leiningen. I have installed Clojure on Windows at C:\clojure-1.5.1
and leiningen-win-installer beta1 at C:\.lein\bin
.
现在我正在尝试Eric Rochester的书的例子。我在project.clj中包含了Incanter的依赖库,并且使用了dep。
Now I am trying the example from Eric Rochester's book. I have included dependent libraries for Incanter in project.clj and also using dep.
如何使用命令(使用'incanter.core)
?我得到'use'不被识别为内部或外部命令
。此外,如何在 user =>
?
How do I use the command (use 'incanter.core)
? I am getting 'use' is not recognized as an internal or external command
. In addition, how do I use lein commands at user=>
?
使用lein命令谢谢!
Thanks!
推荐答案
编辑 - 我忘了lein deps,直到我看到Mars的回答
Edit - I forgot "lein deps" until I saw Mars's answer
启动lein repl,你必须使项目(lein new getting-data或任何书中的内容)。
Before you start lein repl, you have to make the project (with "lein new getting-data" or whatever is in the book).
这将创建一个新目录,并在该目录中找到并编辑project.clj以包含依赖关系(如书中所示)。
That makes a new directory, and in that directory you find and edit "project.clj" to include the dependencies (as shown in book).
cd进入project.clj所在的目录,并从dos / powershell提示符运行lein deps。
cd into the directory that project.clj is in and run "lein deps" from the dos/powershell prompt.
那么当您在同一个目录中运行lein repl时,在user =>提示符下,执行
THEN when you run lein repl, from within that same directory, at the user=> prompt, do
(use 'incanter.core)
它会回到nil,你会运行。你可能希望先从leiningen页面运行一些例子,以获得更多的lein感觉。你总是在user =>提示符处键入clojure命令,而不是在c:....>提示符处。
and it will come back with "nil" and you'll be running. You might want to first run some examples from the leiningen page to get more of a feel for lein. You always type clojure commands at the "user=>" prompt, not at the "c:....>" prompt.
这篇关于如何在leiningen中使用Clojure`use`函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!