为什么尝试在Alexandria软件包中使用功能时,我会得到包裹锁定的错误?
我不明白为什么这完全丢了错误。请解释为什么会以及如何清除这一意外的堵塞。谢谢。
CL-USER> (alexandria::starts-with-subseg "cat" "catdog")
; Debugger entered on #<PACKAGE-LOCKED-ERROR "interning ~A" {10059DE253}>
Lock on package ALEXANDRIA.1.0.0 violated when
interning STARTS-WITH-SUBSEG while in package COMMON-LISP-USER.
(编辑)刚刚意识到这是一个不良的函数名称。但是,我缺少什么?
I don't understand why this is throwing an error at all. Please explain why this would be and how I can clear this unexpected blockage. Thanks.
CL-USER> (alexandria::starts-with-subseg "cat" "catdog")
; Debugger entered on #<PACKAGE-LOCKED-ERROR "interning ~A" {10059DE253}>
Lock on package ALEXANDRIA.1.0.0 violated when
interning STARTS-WITH-SUBSEG while in package COMMON-LISP-USER.
(edit) just realized it's a bad function name. But still, what am I missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
亚历山大
(
如果
Alexandria现在,您将偶然发现“未定义功能”错误。
但是现在,返回您的替代,尝试自动完成错误的功能名称:&nbsp;实际上,这不是很好。当您调用功能,或者只是尝试使用LISP解释器评估符号时,您的LISP首先“实习生”(创建)此符号到相应的软件包中。它现在是“绑定”,除非您将其“解开”它,否则它将留在附近。
亚历山大开发人员采取了防御方法,这很好,因为亚历山大是CL生态系统的重要组成部分。您不想通过错误更改其绑定。想象一下,通过无意义……
但是您不能,您会收到包锁的错误!谢谢你,亚历山大。
您当然可以继续进行重新启动,但是您已经被警告了。
http://www.sbcl.org/manual/manual/#package-package-locks :调用功能时只需要1个冒号:
alexandria:foo
而不是::
。If Alexandria hadn't put a package lock, you would see a more common error message:
But they put a lock:
Now you first saw this lock error, but look further and see the available restarts:
Choose the 0 to ignore the lock, and you'll now stumble on the "undefined function" error.
But now, go back to your REPL, and try to autocomplete the bad function name: you can O_o This is not so great, actually. When you call a function, or simply try to evaluate a symbol with the Lisp interpreter, your Lisp first "interns" (creates) this symbol into the corresponding package. It is now "bound" and it will stay around unless you "unbind" it with
makunbound
.Alexandria developers took a defensive approach, and that's good because Alexandria is an important piece of the CL ecosystem. You don't want to change its bindings by error. Imagine doing, by inadvertance…
But you can't, you get the package lock error! Thank you, Alexandria.
you can of course carry on with the restart, but you've been warned.
http://www.sbcl.org/manual/#Package-Locks
ps: you only need 1 colon when calling a function:
alexandria:foo
and not::
.