Hi.
I am learning Common Lisp, and I use SBCL as my implementation.
Are there any books about the REPL? SBCL's in my case.
I can see that the REPL is a very powerful tool, but I don't know yet
how to use it properly. I would feel more confident, if I knew how to
recover from an error, and, specially, how to debug Common Lisp code.
Is there any place on the Internet, or any book, that can teach me this?
Daniel Cerqueira <dan.list@brilhante.top> writes:
Hi.
I am learning Common Lisp, and I use SBCL as my implementation.
Are there any books about the REPL? SBCL's in my case.
When you say SBCL's REPL, it seems you're using the REPL directly and
not through another software such as the GNU EMACS, say. If you use the program rlwrap (readline-wrap), that's already an improvement to SBCL's
REPL because you get GNU readline support.
But you're using the GNU EMACS, so why not go with SLIME? It's, after
all, the *superior* lisp interaction mode. Screenshot at
https://slime.common-lisp.dev/
I can see that the REPL is a very powerful tool, but I don't know yet
how to use it properly. I would feel more confident, if I knew how to
recover from an error, and, specially, how to debug Common Lisp code.
My SBCL debugger tells me what to do.
$ sbcl
This is SBCL 2.3.7, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (error 'x "hello")
debugger invoked on a SIMPLE-ERROR in thread
#<THREAD tid=7816 "main thread" RUNNING {10013A8003}>:
odd-length initializer list: ("hello").
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
(SB-KERNEL:ALLOCATE-CONDITION X "hello")
0] 0
* (format t "hello~%")
hello
NIL
*
Is there any place on the Internet, or any book, that can teach me this?
Peter Seibel's ``Practical Common Lisp'' guides you with the GNU EMACS
and SLIME. Chapter 2. I use the GNU EMACS and SLIME. It's wonderful.
I saw a bundle of EMACS these days that I can't remember the name. It
came with the GNU EMACS, SBCL and SLIME ready to be used for studying
Common Lisp. Found it---it's called Portacle.
https://portacle.github.io/
You could use it right away while you learn how to set up SLIME on your
own GNU EMACS and take it from there.
Julieta Shem <jshem@yaxenu.org> writes:
Daniel Cerqueira <dan.list@brilhante.top> writes:
Well, sorry for causing confusion. I use GNU Emacs, not SBCL on a
command line. The difference is that, I use M-x run-lisp , instead of
SLIME. SLIME does not let it's users create lisp images, and that put me
off. Besides that important missing feature, if Emacs already has that feature, why install an extra package?
What I specifically am looking for, is how to use the SBCL debugger. It
has a lot of features, and I am looking for some hand-guiding on this
(maybe a book? or an web page?).
Also, it would be great if I just knew how to set up breakpoints on lisp
code (using GNU Emacs), that would take me to the SBCL debugger, when reached.
What I specifically am looking for, is how to use the SBCL debugger.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 497 |
Nodes: | 16 (2 / 14) |
Uptime: | 69:13:43 |
Calls: | 9,766 |
Calls today: | 7 |
Files: | 13,747 |
Messages: | 6,186,079 |