Ann*_*nan 27 lisp windows sbcl file-association
蟒蛇
当我学习Python时,我使用一个很好的gui安装程序在Windows上安装它,所有.py文件都会自动在命令行或资源管理器中运行python.
我发现这非常直观和容易,因为我可以立即制作纯文本文件并运行它们.
口齿不清
我开始学习lisp并且(从评论中)决定SBCL不是一个糟糕的lisp实现.
有没有办法设置SBCL像Python一样轻松运行.lisp文件?
是否有其他具有此功能的lisp实现?
Rai*_*wig 24
Executables
SBCL can save executable images, as Greg Harman mentions (see the :EXECUTABLE keyword): http://www.sbcl.org/manual/index.html#Saving-a-Core-Image
Scripts
Lisp files can be executed as scripts, see: http://www.sbcl.org/manual/#Shebang-Scripts
Command Line Options
SBCL has command line options to evaluate/load lisp code on start: http://www.sbcl.org/manual/#Command-Line-Options
SLIME
SLIME is an Emacs interface for Common Lisp. One can use SBCL via SLIME from within Emacs. Many people prefer Emacs Lisp listeners over typical shell interfaces.
大多数Common Lisp实现具有类似的功能.有关详细信息,请参阅其手册或在此处询问具体实施.
几分钟前,有人回复了我正在寻找的答案.
回复链接到http://www.sbcl.org/manual/Shebang-Scripts.html,这对于找出我的解决方案非常有帮助.无论是谁,都不应该删除他们的答案,因为我要将其标记为正确;)
我的最终解决方案是创建一个批处理脚本,该脚本通过正常的程序文件关联链接作为打开.lisp文件的程序(右键单击文件 - >属性 - >打开方式 - > [更改]).
@ECHO OFF
"C:\Program Files\Steel Bank Common Lisp\1.0.37\sbcl.exe" --script %1
Run Code Online (Sandbox Code Playgroud)
当您在资源管理器中双击文件时,它会执行它们,当您在命令行中运行它们时,它会执行相同的操作.