Lisp的可執行
回答
實際上,我是想這樣做今天,我發現打字這個到CLISP REPL工作:
(EXT:SAVEINITMEM "executable.exe"
:QUIET t
:INIT-FUNCTION 'main
:EXECUTABLE t
:NORC t)
,其中主要是你想打電話時,該功能的名稱程序啓動,:QUIET t
抑制啓動旗幟,:EXECUTABLE t
,使本機的可執行文件。
它也可以調用
(EXT:EXIT)
在你的主函數的末尾,以便從程序完成後得到一個互動的口齒不清提示停止對用戶有用的。
編輯:閱讀文檔,您可能還需要添加:NORC t
(閱讀link)。這會禁止加載RC文件(例如,~/.clisprc.lisp
)。
在mac os上的ccl x 10.9我有一個創建可執行文件的問題。 `(保存的應用程序「/全/路徑/到/保存的應用內」:前置內核噸)` 雙擊產生可執行文件上輸入端子示出開始與一個像錯誤很長的錯誤:問題loadiing束:無法確定類名並以內核調試器選項結束。在Windows上CCL我簡單地定義一個函數,做同樣的上述保存可執行文件,以後我可以雙擊它運行,並記得在Mac我定義的功能,CCL也不記得當我保存圖像的輸出文件並加載它手動內核 – 2014-01-06 00:53:15
看看在官方主頁CLISP。有一個常見問題回答這個問題。
這是一個Lisp FAQ(稍作改動):
*** How do I make an executable from my programme?
This depends on your implementation; you will need to consult your vendor's documentation.
With ECL and GCL, the standard compilation process will produce a native executable.
With LispWorks, see the Delivery User's Guide section of the documentation.
With Allegro Common Lisp, see the Delivery section of the manual.
etc...
However, the classical way of interacting with Common Lisp programs does not involve standalone executables. Let's consider this during two phases of the development process: programming and delivery.
Programming phase: Common Lisp development has more of an incremental feel than is common in batch-oriented languages, where an edit-compile-link cycle is common. A CL developer will run simple tests and transient interactions with the environment at the REPL (or Read-Eval-Print-Loop, also known as the listener). Source code is saved in files, and the build/load dependencies between source files are recorded in a system-description facility such as ASDF (which plays a similar role to make in edit-compile-link systems). The system-description facility provides commands for building a system (and only recompiling files whose dependencies have changed since the last build), and for loading a system into memory.
Most Common Lisp implementations also provide a "save-world" mechanism that makes it possible to save a snapshot of the current lisp image, in a form which can later be restarted. A Common Lisp environment generally consists of a relatively small executable runtime, and a larger image file that contains the state of the lisp world. A common use of this facility is to dump a customized image containing all the build tools and libraries that are used on a given project, in order to reduce startup time. For instance, this facility is available under the name EXT:SAVE-LISP in CMUCL, SB-EXT:SAVE-LISP-AND-DIE in SBCL, EXT:SAVEINITMEM in CLISP, and CCL:SAVE-APPLICATION in OpenMCL. Most of these implementations can prepend the runtime to the image, thereby making it executable.
Application delivery: rather than generating a single executable file for an application, Lisp developers generally save an image containing their application, and deliver it to clients together with the runtime and possibly a shell-script wrapper that invokes the runtime with the application image. On Windows platforms this can be hidden from the user by using a click-o-matic InstallShield type tool.
CLiki有一個很好的答案,以及:Creating Executables
;;我知道這是一個老問題,但我看Lisp代碼是25歲:-)
我不能讓編譯與CLISP在Windows 10 工作然而,它爲我工作與保利協鑫
https://www.cs.utexas.edu/users/novak/gclwin.html
;;;我口齒不清文件jugs2.lisp
GCL -compile jugs2.lisp ;;這會產生文件jugs2.o if jugs2。LISP文件沒有錯誤
;;不帶參數運行GCL推出Lisp解釋 GCL
;;加載.o文件
(load "jugs2.o")
;;創建一個exe文件
(si:save-system "jugs2")
;;當exe運行時,需要使用dll oncrpc.dll ;;這是在gcl.bat創建的\ lib \ gcl-2.6.1 \ unixport文件夾中。
;;運行時,它顯示了一個口齒不清的環境,請致電(主)運行的主要功能 (主)
- 1. Lisp - 「案例」的宏執行
- 2. Common Lisp的:獨立的可執行文件和共享C庫
- 3. 如何縮小Clozure Common Lisp可執行文件的大小?
- 4. 我可以在Lisp中執行此操作嗎?
- 5. 如何在LISP中執行while循環
- 6. Common Lisp:執行表單直到無
- 7. 如何在Dart中執行LISP(申請)?
- 8. 持續執行emacs lisp功能
- 9. LISP嵌套循環並行執行。如何迫使它順序執行?
- 10. 根據Emacs中的環境,動態「magit」Git可執行文件lisp
- 11. lisp中「#'」的行爲
- 12. 使用執行/可執行
- 13. 爲什麼是Common Lisp的Web程序的執行我不能
- 14. Clean Lisp可讀性
- 15. 可執行的jar
- 16. 可執行的URL
- 17. macOS .app的可執行性與.exe的可執行性如何?
- 18. 執行使用Powershell執行的C#可執行文件出錯
- 19. 流浪:可執行文件是不可執行的
- 20. 爲OS X製作可執行的可執行文件
- 21. 如何在emacs lisp中執行SQL查詢?
- 22. 依次在LISP中執行多個命令
- 23. 如何在lisp中執行值賦值問題
- 24. IIS可執行文件沒有執行
- 25. C#可執行文件執行目錄
- 26. Qt執行外部可執行程序?
- 27. JavaScript的執行程序運行時可執行的JAR文件
- 28. 可執行文件
- 29. 可執行優化
- 30. 'express'不可執行
你可以使用`編譯file`代替。 – 2016-07-17 03:05:39