在 Paradise 中导入 Clojure 库时遇到问题

发布于 2024-09-09 02:45:47 字数 1411 浏览 9 评论 0原文

我偶尔会遇到这个问题,并且通常会解决它,但这相当令人沮丧。

我的类路径上有所有 Incanter (如果你不知道的话请检查一下:它非常棒)。我尝试像这样导入它(通过 Slime REPL): user> (使用'incter.core),但失败了。

这样做: user> (use 'clojure.contrib.def) 工作得很好,并且这个文件位于我的类路径上的同一个位置。

无论如何,该错误与类路径无关:它是这样的:

Don't know how to create ISeq from: clojure.lang.Symbol
  [Thrown class java.lang.IllegalArgumentException] 

您可以在此处看到我的整个终端 (屏幕截图。)

我不知道这里发生了什么,这真的很令人沮丧,因为我真的很想使用 Incancter,而且我可以从 Incanter 二进制文件的 REPL 中获得。我绝对不想以此为基础进行开发——而这应该可行。

任何帮助将非常感激。

编辑:

看起来 Incanter 需要 Clojure 1.2,并且lein swank 给了我 Clojure 1.1。这可能是我遇到问题的原因:如果是这样,有没有办法继续使用 Swank & Lein 与 Clojure 1.2

再次感谢!

编辑:

显然,如果您开始使用 Clojure-1.1 和 lein swank,除非您创建一个新项目,否则您将不得不使用它。

如果以后的人遇到这个问题,这篇文章帮助了我,但是还有,至少对我来说,如果您使用leink swank和Clojure开始了一个新的lein项目,那么您必须开始一个新的lein项目-1.1. 简单地更改您的project.clj 文件,然后再次lein swank 是行不通的。

I occasionally get this problem, and generally work around it, but it's rather frustrating.

I have all of Incanter (check it out if you don't know it: it's superb) on my classpath. I try to import it (through a Slime REPL) like this: user> (use 'incanter.core), but fail.

Doing this: user> (use 'clojure.contrib.def) works just fine, and this file is in the same place–on my classpath.

Regardless, the error isn't anything about classpath: it's this:

Don't know how to create ISeq from: clojure.lang.Symbol
  [Thrown class java.lang.IllegalArgumentException] 

You can see my entire terminal here (a screenshot.)

I don't know what's going on here, and it's really frustrating, as I really would like to use Incancter, and I can from the Incanter binary's REPL. I definitely don't want to develop from that–and this should work.

Any help would be much appreciated.

EDIT:

It appears as though Incanter requires Clojure 1.2, and lein swank gives me Clojure 1.1. This might be the cause of my problems: if so, is there a way to continue to use Swank & Lein with Clojure 1.2?

Thanks again!

EDIT:

Apparently if you start using Clojure-1.1 and lein swank, you're stuck with it unless you make a new project.

If future people have this problem, this article helped me out, but also, at least for me, you must start a new lein project if you had begun it using leink swank and Clojure-1.1. Simply changing your project.clj file and then lein swanking again doesn't work.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

木有鱼丸 2024-09-16 02:45:47

是的,您可以将 Leiningen 和 swank-clojure 与 Clojure 1.2 一起使用。您可能需要使用最新版本的 Leiningen(我不确定某个旧限制是否仅影响 lein repl,还是也影响 lein swank;无论如何,请尝试您可以在 GitHub 的下载部分找到 1.2-RC2。您还需要使用最近的 swank-clojure;我自己使用最先进的结帐工具,请在此处获取您的结帐工具。

除此之外,只需使用 Clojure 和 contrib 的 1.2 jar 即可。 (Lein 使用它自己的 Clojure,与用于 lein swank 的 Clojure 分开,用于其内部工作,您永远不需要关心它;swank-clojure 没有 AOT 命名空间,并且不特别关心 Clojure 版本,除非偶尔(很长一段时间!)当出现问题时,会应用补丁并恢复快乐。)

我希望上述内容有所帮助,但如果没有:您的问题描述对我来说并不完全足够清楚地了解正在发生的事情。您能否添加有关“所有 Incanter”在您的类路径中意味着什么的信息(您是指 jar 吗?源?您从哪里获得它们?您如何设置您的类路径?) 。如果不了解这一点,就很难复制您的设置来尝试追踪问题的根源。
当然,如果升级某些版本可以解决问题,请忽略我当前的困惑。 ;-)

Yes, you can use Leiningen and swank-clojure with Clojure 1.2. You might need to use a recent version of Leiningen (I'm not sure if a certain old limitation affected lein repl only or was it lein swank as well; anyway, try the 1.2-RC2 which you'll find in the downloads section on GitHub). You will also need to use a recent-enough swank-clojure; I use a bleeding edge checkout myself, get yours here.

Other than that, simply use 1.2 jars for Clojure and contrib. (Lein uses it's own Clojure, separate from the one used for lein swank, for its internal workings and you never need to care about it; swank-clojure has no AOT'd namespaces and doesn't particularly care about the Clojure version, except once in a (long!) while something breaks, a patch is applied and joy is restored.)

I hope the above helps, but if it doesn't: your problem description is not entirely sufficient for me to get a clear picture of what is happening. Could you add information on what it means for "all of Incanter" to be on your classpath (do you mean the jars? sources? where do you get them? how do you set your classpath?). Without knowing this, it'll be hard to replicate your setup to try to track down the source of the problem.
Of course if bumping some versions fixes things, please disregard my current confusion. ;-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文