Oli*_*Cox 4 lisp sbcl common-lisp
我想知道您是否可以帮助解决我在 SBCL 中遇到的错误。我正在做一个教程,第一课就是将脚本加载到 LISP 中。这是名为 hello.lisp 的脚本:
(defun hello ()
"say hello to USER"
(format t "hello ~a" (uiop:getenv "USER")))
(hello)
Run Code Online (Sandbox Code Playgroud)
但是当我运行命令:(加载“hello.lisp”)时,出现以下错误:
debugger invoked on a SB-C::INPUT-ERROR-IN-LOAD in thread
#<THREAD "main thread" RUNNING {1000510083}>:
READ error during LOAD:
Package UIOP does not exist.
Line: 3, Column: 36, File-Position: 74
Stream: #<SB-INT:FORM-TRACKING-STREAM for "file /home/oliver/Programs/hello.lisp" {10015403F3}>
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Abort loading file "/home/oliver/Programs/hello.lisp".
1: Exit debugger, returning to top level.
(SB-C:COMPILER-ERROR SB-C::INPUT-ERROR-IN-LOAD :CONDITION #<SB-INT:SIMPLE-READER-PACKAGE-ERROR "Package ~A does not exist." {1001542543}> :STREAM #<SB-INT:FORM-TRACKING-STREAM for "file /home/oliver/Programs/hello.lisp" {10015403F3}>)
Run Code Online (Sandbox Code Playgroud)
关于如何解决的任何想法?我似乎缺少“UIOP”,但我不知道如何安装。提前致谢!
奥利弗
小智 5
(require :uiop)
Run Code Online (Sandbox Code Playgroud)
看来您正在使用--scriptsbcl 的选项,这使得 sbcl 无法加载某些内容,例如 asdf、uiop 等。