`lein try` 中 ClojureScript 库的 REPL 会话
REPL session for a ClojureScript library in the vein of `lein try`
有时我想在 REPL 中试用一个库。例如,当我需要知道从现在起 100 天后的日期时,我会这样做:
lein try clj-time
(require '[clj-time.core :as t])
(t/plus (t/today) (t/days 100))
或带引导:
boot -d clj-time repl -e "(require '[clj-time.core :as t])"
(t/plus (t/today) (t/days 100))
这已经很棒了,但是还有几秒钟的启动时间。
我的问题:我能否使用 ClojureScript 和 Node 获得相同的功能并且启动时间可能更快?如何使用 cljs-time?
获取上面的示例
您可以将 Planck 与您想要尝试的 jar 一起使用,方法是将其添加到 Planck 的 "classpath"(这不是实际的类路径,因为不涉及 JVM)。见 Planck Dependencies documentation.
例如:
planck -c ~/.m2/repository/com/andrewmcveigh/cljs-time/0.4.0/cljs-time-0.4.0.jar
有时我想在 REPL 中试用一个库。例如,当我需要知道从现在起 100 天后的日期时,我会这样做:
lein try clj-time
(require '[clj-time.core :as t])
(t/plus (t/today) (t/days 100))
或带引导:
boot -d clj-time repl -e "(require '[clj-time.core :as t])"
(t/plus (t/today) (t/days 100))
这已经很棒了,但是还有几秒钟的启动时间。
我的问题:我能否使用 ClojureScript 和 Node 获得相同的功能并且启动时间可能更快?如何使用 cljs-time?
获取上面的示例您可以将 Planck 与您想要尝试的 jar 一起使用,方法是将其添加到 Planck 的 "classpath"(这不是实际的类路径,因为不涉及 JVM)。见 Planck Dependencies documentation.
例如:
planck -c ~/.m2/repository/com/andrewmcveigh/cljs-time/0.4.0/cljs-time-0.4.0.jar