相当于“lein swank”到 emacs/slime 的其他 Lisp/Scheme 实现

发布于 2024-09-16 06:22:23 字数 235 浏览 5 评论 0原文

我一直在使用 emacs/slime 来编码 lisp,但是使用 Clojure 我发现了“lein swank”。 我必须说它非常有用,因为我可以连接到运行 clojure 的服务器。

其他 Lisp 实现怎么样?哪些 Lisp 实现提供了与 Clojure 中的“lein swank”等效的功能?我的意思是,是否有任何其他 Lisp 实现提供服务器连接,以便我使用“Mx slime-connect”,而不仅仅是“Mx slime”?

I've been using emacs/slime for coding lisp, but with Clojure I found 'lein swank'.
I must say that it's pretty useful, as I can connect to a server that runs clojure.

How about the other Lisp implementations? What Lisp implementations provide the equivalent of 'lein swank' in Clojure? I mean, is there any other Lisp implementations that provide server connectivity so that I use 'M-x slime-connect', not just 'M-x slime'?

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

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

发布评论

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

评论(4

小姐丶请自重 2024-09-23 06:22:23

非 clojure swank 后端不需要 lein swank 等效项,因为它们只需启动一个 lisp 实例并在运行时更改其加载路径以使其适用于给定项目。这种方法不适用于 Clojure,因为 JVM 的类路径无法在运行时修改。

Non-clojure swank backends don't need a lein swank equivalent since they can just launch a lisp instance and change its load-path at runtime to make it work for a given project. That approach doesn't work with Clojure since the JVM's classpath can't be modified at runtime.

深海少女心 2024-09-23 06:22:23

我不知道 clisp,但这就是我对 SBCL 的了解。这也与我的 clojure swank 设置共存。我不使用 ELPA,而是完全手动设置。

(add-to-list 'load-path "~/src/slime")
(require 'slime)
(add-to-list 'slime-lisp-implementations '(sbcl ("/usr/local/bin/sbcl")))
(setq slime-default-lisp 'sbcl)

我有一个手工编译的 SBCL。我在 SLIME CVS 代码库中看到了 CLISP 的华丽后端,所以我想,将 slime-default-lisp 和 slime-lisp-implementations 更改为 clisp 可能会起作用。

lein swank 主要用于在特定项目上启动 swank 端口。这是必需的,因为 JVM 类路径无法在运行时修改。因此,我们使用 lein swank 或 swank-clojure-project 启动 java,并将类路径设置为项目目录和依赖项。对于 CL,这不是必需的,因为可以在运行时修改路径名。

我已将完整的配置文件发布在: http://github.com/vu3rdd/dotfiles

我会很高兴帮助您设置完全手动的 emacs/slime/swank 设置。

I don't know about clisp, but this is what I have for SBCL. This co-exists with my clojure swank setup as well. I don't use ELPA and instead have a completely manual setup.

(add-to-list 'load-path "~/src/slime")
(require 'slime)
(add-to-list 'slime-lisp-implementations '(sbcl ("/usr/local/bin/sbcl")))
(setq slime-default-lisp 'sbcl)

I have a hand compiled SBCL. I see a swank backend for CLISP in the SLIME CVS codebase, so I guess, changing slime-default-lisp and slime-lisp-implementations to clisp probably will just work.

lein swank mainly exists for starting swank port on a particular project. This is needed because JVM classpaths cannot be modified at runtime. So, we start java with classpaths set to our project directories and dependencies using lein swank or swank-clojure-project. With CL, this is not necessary, as pathnames can be modified during runtime.

I have posted the complete config file at: http://github.com/vu3rdd/dotfiles

I will be glad to help setting up a fully manual emacs/slime/swank setup.

溺深海 2024-09-23 06:22:23

您可以在 CL 中手动加载 swank 并启动服务器(毕竟 slime/swank 是为 CL 创建的)。

You can load swank manually in CL and start the server (slime/swank were created for CL after all).

无人问我粥可暖 2024-09-23 06:22:23

启动 Lisp 实现,加载 Swank(例如,通过 Quicklisp),然后运行 ​​swank:create -server

CL-USER(1): (ql:quickload "swank")
;; ...
CL-USER(2): (swank:create-server)
;; Swank started at port: 4005.
4005

如果您想指定不同的端口,可以使用 :port 关键字参数来实现:

CL-USER(3): (swank:create-server :port 4123)
;; Swank started at port: 4123.
4123

请注意,由于协议在版本之间往往会发生变化,因此您需要确保您没有使用截然不同的 SLIME 和 Swank 版本。对于 Common Lisp,我倾向于使用 Quicklisp 的版本,将以下内容放入我的 .emacs 中,具体取决于 Quicklisp 中当前可用的 SLIME 版本:

(add-to-list 'load-path "~/quicklisp/dists/quicklisp/software/slime-20111105-cvs")
(add-to-list 'load-path "~/quicklisp/dists/quicklisp/software/slime-20111105-cvs/contrib")

Fire up the Lisp implementation, load Swank (via Quicklisp, for example), and run swank:create-server:

CL-USER(1): (ql:quickload "swank")
;; ...
CL-USER(2): (swank:create-server)
;; Swank started at port: 4005.
4005

If you want to specify a different port, you can do so by using the :port keyword argument:

CL-USER(3): (swank:create-server :port 4123)
;; Swank started at port: 4123.
4123

Note that since the protocol tends to change between versions, you need to make sure that you are not using wildly different versions of SLIME and Swank. For Common Lisp, I tend to use the versions from Quicklisp by putting something like the following into my .emacs, depending on the version of SLIME currently available in Quicklisp:

(add-to-list 'load-path "~/quicklisp/dists/quicklisp/software/slime-20111105-cvs")
(add-to-list 'load-path "~/quicklisp/dists/quicklisp/software/slime-20111105-cvs/contrib")
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文