Lisp的可执行文件 [英] Lisp Executable
问题描述
我刚开始学习Lisp和我想不出如何编译和链接口齿不清code到一个可执行文件。
I've just started learning Lisp and I can't figure out how to compile and link lisp code to an executable.
我用 CLISP
和 CLISP -c
产生两个文件:
- .fas
- 的.lib
什么下一步得到一个可执行文件怎么办?
What do I do next to get an executable?
推荐答案
实际上,我是想这样做今天,我发现这个打字到CLISP REPL工作:
I was actually trying to do this today, and I found typing this into the CLisp REPL worked:
(EXT:SAVEINITMEM "executable.exe"
:QUIET t
:INIT-FUNCTION 'main
:EXECUTABLE t
:NORC t)
在这里主要是要调用的函数的名称,当程序启动,:QUIET牛逼SUP presses启动旗帜,:可执行牛逼使得本机的可执行文件。
where main is the name of the function you want to call when the program launches, :QUIET t suppresses the startup banner, and :EXECUTABLE t makes a native executable.
它也可以是有用的调用
(EXT:EXIT)
在主要的功能,以便从程序完成后得到一个互动的口齿不清提示停止用户结束。
at the end of your main function in order to stop the user from getting an interactive lisp prompt when the program is done.
编辑:阅读的文档,您可能还需要补充:NORCŤ
(阅读链接)。这燮presses加载RC文件(例如,〜/ .clisprc.lisp)。
Reading the documentation, you may also want to add :NORC t (read link). This suppresses loading the RC file (for example, ~/.clisprc.lisp).
这篇关于Lisp的可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!