保存Lisp状态 [英] Saving lisp state

查看:102
本文介绍了保存Lisp状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Lisp的初学者,有个问题. 当我直接在REPL中编写一些代码(没有任何.lisp文件!)时,如何保存解释器的工作/状态以在下次还原它并继续工作?

I am a beginner in lisp and have a question. When I writing some code directly in REPL (without any .lisp file!), how can I save my work/state of the interpreter to restore it next time and continue working?

(我正在使用ECL)

感谢!对不起,我的英语不好;)

Thanx! And sorry for my broken english ;)

推荐答案

来自 ECL手册:

传统上,Common Lisp实现为 保存转储中的所有数据 将Lisp进程运行到一个文件中.结果称为Lisp图片 并可以运送到其他兼容版本 如今,对它运行的系统的控制较少 在其中,Lisp实现必须非常努力地转储内存映像 然后可以加载并执行它们.

Tratidionally, Common Lisp implemenations have provided a function to save the dump all data from a running Lisp process into a file. The result was called the Lisp image and could be shipped to other version compatible implementations.Nowadays, having less control of the systems it runs in, a Lisp implementation must work very hard to dump memory images and be able to load and execute them afterwards.

ECL已选择完全避免此过程.相反,我们构想 五个不同的便携式模型,用于构建和发布程序. 表1.1中描述的模型列举了不同类型的 ECL可以移植产生的文件.获得一个或多个 表格中提到的产品,您可以使用低级API 在第三部分中描述.但是,我们建议根据以下方法更简单的方法 使用系统定义文件来描述您的结构 项目,然后让ECL为您建立所需的目标.这种方法是 在以下各节中进行了介绍.

ECL has chosen to avoid this process entirely. Instead, we conceive five different portable models for building and shippin your programs. The models, described in Table 1.1, enumerate the different kinds of files that ECL can portably produce. To get one or more of the products mentioned in the table, you may resort to a low level API described in Part III. However, we recommend a simpler way based on using System Definition Files to describe the structure of your project and let ECL build the desired target for you. This approach is described in the following sections.

(强调我的意思),看来,您对ECL感到不走运.但是, CLISP

(emphasis mine) so it seems, you are out of luck with ECL. However, CLISP, CCL, and SBCL support this feature, so if you want it and if switching is an option... Give one of those a try.

这篇关于保存Lisp状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆