I'm encountering an issue when trying to run a Lisp script in Emacs with SBCL. I have the following directory structure:
- SBCL: /home/user/.roswell/impls/x86-64/linux/sbcl-bin/2.3.8/bin/sbcl
- Lisp Script : /home/user/src/q1.lisp
- Emacs: - /var/lib/dpkg/alternatives/emacs
- /var/lib/emacsen-common/state/flavor/installed/emacs
I load the script in Emacs using Alt-X load-file and then provide the full path to the hello.lisp file.
Here's the content of my hello.lisp file:
(defun hello-lisp ()
(format t "Hello, Lisp!~%"))
(hello-lisp)
However, when I attempt to run it, I receive the error message "Wrong type argument: stringp, t." I'm not sure why I'm getting this error, and I'm looking for guidance on how to properly execute Lisp scripts in my environment.
As far as I can tell, you're not using SBCL or Slime at all here. You're using Emacs command
load-file, and loading a file that's interpreted as Emacs Lisp, not Common Lisp. That's whatload-filedoes.The error is that Elisp function
formatis different from Common Lisp functionformat. The Elisp function expects a format string, not the symbolt, as its first argument. UseC-h f formatto see its description.