Common Lisp 中重置状态
新手 Common Lisp 问题在这里。
有没有办法重置环境状态?我的意思是,是否有一些命令可以使 REPL 恢复到启动后的相同状态,即取消所有变量、函数等。或者如果这不在 Common Lisp 标准中,是否有一些扩展在 SBCL (我使用的实现)中做到这一点?
(编辑:我知道在 SLIME 中,Mx slime-restart-inferior-lisp 会这样做,但我想知道是否有一种无需重新启动进程的方法)
Newbie Common Lisp question here.
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: 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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一般来说不是,不是。我偶尔想做类似的事情,所以我的工作流程通常是创建一个新包来保存我正在启动的任何项目,然后当我想重置东西时我使用 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.
使用 Cc Mo,如 REPL 菜单的清除缓冲区中所示
Use C-c M-o, as given in REPL menu's Clear Buffer