将 slimv 与 Clojure 结合使用

发布于 2024-12-16 14:26:16 字数 444 浏览 4 评论 0原文

有没有关于将 slimv 与 clojure 一起使用的文档?

我将它连接到 lein swank 并有一个工作 repl,但不知道如何实际用它做任何事情。如何让它加载 lein 项目及其命名空间?尝试按照 教程 进行操作,但它似乎不能很好地转换为 clojure。我尝试告诉它加载我的命名空间,它似乎有效,但如果我尝试执行我的函数之一,我得到:

Unable to resolve symbol: handle-text-message in this context
  [Thrown class java.lang.RuntimeException]

Restarts:
  0: [QUIT] Quit to the SLIME top level

Are there any docs on using slimv with clojure?

I got it connected to a lein swank and have a working repl but can't figure out how to actually do anything with it. How do you get it to load a lein project and its namespaces? Tried following the tutorial but it doesn't seem to translate well to clojure. I tried telling it to load my namespace, and it seemed to work, but if I try executing one of my functions, I get:

Unable to resolve symbol: handle-text-message in this context
  [Thrown class java.lang.RuntimeException]

Restarts:
  0: [QUIT] Quit to the SLIME top level

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

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

发布评论

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

评论(1

哀由 2024-12-23 14:26:16

lein swank 不会在加载代码时启动。但是,它确实以正确的类路径开头,以便您可以加载代码。

在最顶层的文件中,您可以使用 ,b 加载整个文件,并且您的整个程序/应该/从那里加载。

例如,在 https://github.com/elarkin/ants-demo< 的根目录启动 swank 实例/a> 将加载正确设置类路径的 swank 服务器。

如果您随后在 VIM 中连接到该 swank 实例(使用 ,c)并在文件 /src/ants/ui.clj 上使用 ,b,则将加载整个程序。

您可以通过手动运行 main 方法(-main)来查看证明

lein swank does not start with your code loaded. It does however start with the correct classpath such that you can load your code.

In your topmost file, you can use ,b to load the entire file, and your entire program /should/ load from there.

For example, starting a swank instance at the root of https://github.com/elarkin/ants-demo will load a swank server with the classpath set correctly.

If you then connect to that swank instance in VIM (using ,c) and use ,b on the file /src/ants/ui.clj the entire program will be loaded.

You can see proof by manually running the main method (-main)

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