require core.async in a lein repl

Ant*_*ald 4 clojure leiningen clojurescript

In a fresh lein (~2.5) repl, I type:

 (require '[clojure.string :as string])
Run Code Online (Sandbox Code Playgroud)

And I can use string as expected. However, when trying to require core.asnc like so, I get an error msg:

(require '[clojure.core.async :as ca])
FileNotFoundException Could not locate clojure/core/async__init.class or clojure/core/async.clj on classpath.  clojure.lang.RT.load (RT.java:449)
Run Code Online (Sandbox Code Playgroud)

多亏了您的回答,我现在设法在运行时使用石榴或紫苏的任意库。但是宏呢?例如-如何在repl中获得'go'宏?没有类似(require-macros ...的东西,类似于在项目的ns声明中需要core.async时所采用的方法。

noi*_*ith 5

core.async不属于clojure.core库。您需要将core.async jar或源添加到类路径。最简单的方法是通过project.clj进行依赖,但是在运行时也可以使用石榴和alembic之类的工具,可以将其添加到本地profile.clj中。