I have emacs with SLIME and SBCL. And I got stuck with the problem that emacs has definition of 'FORMAT' as format string &rest objects, so at REPL when I'm trying to evaluate something like (format t "hello"), I get error: Wrong type ar开发者_开发百科gument: stringp, t.
Is this the case of function to be overridden? How can I make emacs to use function defined in SBCL?
Guess that it's rather simple newbie problem, but it's really hard to google for 'format' keyword :)
Emacs Lisp and Common Lisp (SBCL is an implementation of it) are two different languages; it is as if you were asking how to call Java's System.out.println
from your Emacs Lisp.
Emacs Lisp is used to extend and customize the behavior or Emacs.
Common Lisp is a general purpose programming language, of which there are several implementations, SBCL being one of them. It is not related to Emacs or Emacs Lisp (except, perhaps historically and culturally).
SLIME is a tool to talk to a running Common Lisp image from inside Emacs, you must first start it with M-x slime
; after you have started SLIME, you can send forms to your running Common Lisp image (SBCL in your case) within the *slime-repl sbcl*
buffer.
You will find another buffer named *scratch*
where you can type and evaluate Emacs Lisp forms. Just remember that this has nothing to do with Common Lisp.
But, you need to be aware that there is an Emacs Lisp extension that adds many Common Lisp constructs to Emacs Lisp, but it is still Emacs Lisp, don't get confused if you read something about that.
Yeah it may be confusing at first, but don't worry, it's only temporal.
Edit: I would like to add that if you are interested in Common Lisp, you should read one or all of the following books:
- Common Lisp: A Gentle Introduction to Symbolic Computation
- Land of Lisp
- Practical Common Lisp
On the other hand, if you are interested in extending and customizing Emacs itself, you should read the following book:
- http://www.gnu.org/software/emacs/emacs-lisp-intro/emacs-lisp-intro.pdf
Good luck.
After some investigation I found out that SLIME init script in .emacs config file was incorrect. So, while I was using inferior-lisp, it was not SBCL. Here's the link explaining the matter: slime-devel list.
So, I changed (setq inferior-lisp-program "/some/path/to/sbcl/executable.exe")
to (setq inferior-lisp-program "sbcl")
in config file. And that got me to SBCL in it's perfect nature :)
精彩评论