简体   繁体   English

来自USB驱动器的Clojure REPL

[英]Clojure REPL from USB drive

I'm trying to learn Clojure at the moment, but off to my parents this weekend. 我现在正在努力学习Clojure,但本周末我的父母还在学习。 They have a Windows laptop, but I don't want to install anything...so is it possible to run a Clojure REPL solely with files installed on a USB drive? 他们有一台Windows笔记本电脑,但我不想安装任何东西......那么是否可以单独使用安装在USB驱动器上的文件运行Clojure REPL?

Sure, absolutely this will work. 当然,绝对会这样。 If you install both Java and Clojure onto a flash drive, it will work just the same as if you installed it onto a normal hard drive. 如果将Java和Clojure安装到闪存驱动器上,它的工作方式与将其安装到普通硬盘驱动器上的工作方式相同。

As this blog post recommends you can set up a clj.bat file: 正如本博文建议您可以设置clj.bat文件:

@ECHO OFF
java -cp clojure.jar clojure.lang.Repl

Just keep in mind that your parent's laptop won't have any environment variables set (ie PATH), so depending on where everything is located, you will need to tweak it to make sure java is recognized, and clojure.jar is on the classpath. 请记住,您父母的笔记本电脑不会设置任何环境变量(即PATH),因此根据所有内容的位置,您需要调整它以确保识别出java ,并且clojure.jar位于类路径上。

The best portable clojure "environment" that I have come across is Lisp Cabinet . 我遇到的最好的便携式clojure“环境”是Lisp Cabinet

It gives the option of multiple lisp environments, but you can choose to just have a clojure environment. 它提供了多个lisp环境的选项,但您可以选择只有一个clojure环境。 It is a little dificult to discern from the website that it's portable, but the installer gives you the option of installing everything in one folder for a completely portable experience. 从网站上辨别它是可移植的有点困难,但安装程序让您可以选择将所有内容安装在一个文件夹中,以获得完全便携的体验。

Edit: As for a repl, when you launch it, Lisp Cabinet gives you an emacs slime REPL for the environments that you choose (that would probably just be clojure). 编辑:至于repl,当你启动它时,Lisp Cabinet为你选择的环境(可能只是clojure)给你一个emacs slime REPL。

You could also install leiningen on the USB drive. 您也可以在USB驱动器上安装leiningen Then call 然后打电话

/path/to/USB/lein.bat repl

Enjoy! 请享用!

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

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