在Common Lisp中重置状态 [英] Reset state in Common Lisp

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

问题描述

这里是新手Common Lisp问题。

Newbie Common Lisp question here.

有没有一种方法可以重置环境状态?我的意思是,是否有一些命令可以将REPL返回到启动后的状态,即取消对所有变量,函数等的intern。或者如果不是Common Lisp标准,则是否存在某些扩展名

Is there a way to reset the state of the environment? What I mean, is there some command that brings the REPL back to the same state it was right after it started up, that is, uninterning all variables, functions, etc. Or if that's not in the Common Lisp standard, is there some extension in SBCL (the implementation I use) to do that?

EDIT :我知道在SLIME中, Mx粘液重启-inferior-lisp 可以做到这一点,但我想知道是否有一种方法可以不重新启动进程)

(EDIT: I know that in SLIME, M-x slime-restart-inferior-lisp does that but I wonder if there's a way without restarting the process)

推荐答案

,不。有时我想做类似的事情,所以我的工作流程通常是创建一个新程序包来保存我正在启动的任何项目,然后在我想重置内容时使用DELETE-PACKAGE。我从来没有在CL-USER软件包中做任何工作,因为不同的实现将不同的东西塞进其中。

Not in general, no. I occasionally want to do something like that, so my workflow is generally to create a new package to hold whatever project I'm starting, then when I want to reset things I use DELETE-PACKAGE. I never do any work in the CL-USER package, since different implementations have different things stuffed into it.

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

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