简体   繁体   English

与“尝试尝试”有关的ClojureScript库的REPL会话

[英]REPL session for a ClojureScript library in the vein of `lein try`

Sometimes I want to try out a library in a REPL. 有时我想在REPL中试用一个库。 For example when I need to know the date 100 days from now, I do: 例如,当我需要知道距现在100天的日期时,我会做:

lein try clj-time
(require '[clj-time.core :as t])
(t/plus (t/today) (t/days 100))

Or with boot: 或使用启动:

boot -d clj-time repl -e "(require '[clj-time.core :as t])"
(t/plus (t/today) (t/days 100))

This is already great, but this still has a few seconds of start up time. 这已经很不错了,但是仍然有几秒钟的启动时间。

My question: can I get the same functionality using ClojureScript and Node and perhaps have a faster startup time? 我的问题:我可以使用ClojureScript和Node获得相同的功能,并且启动时间可能更快吗? How can I get the example above with cljs-time ? 如何使用cljs-time获得以上示例?

You can use Planck with the jar you're wanting to try by adding it to Planck's "classpath" (it's not an actual classpath since there's no JVM involved). 您可以将Planck与想要使用的jar一起使用,方法是将其添加到Planck的“类路径”(由于不涉及JVM,因此不是实际的类路径)。 See the Planck Dependencies documentation . 请参阅“ Planck依赖关系”文档

Eg: 例如:

planck -c ~/.m2/repository/com/andrewmcveigh/cljs-time/0.4.0/cljs-time-0.4.0.jar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM