I was interested in changing the REPL for SBCL.
On Mon, 12 Oct 2026 17:32:46 -0400, steve g wrote:
I was interested in changing the REPL for SBCL.
Probably easier to run it in an environment like Jupyter. Even without
a custom SBCL kernel, just the regular rCL%%script magicrCY already lets
you do some useful things.
raE
%%script sbcl
(+ 2 2)
raA
This is SBCL 2.6.4.debian, 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.
* 4
*
You probably want to turn off the startup banner message, and the rCL*rCY characters from the default prompting for input by the REPL. The
`--script` option does this, but it also turns off automatic output of expression values:
raE
%%script sbcl --script
(+ 2 2) ; produces no output
(princ (+ 2 2)) ; need to do explicit output
raA
4
This may be OK for running functional scripts, but it is not so
convenient for simple experimentation.
Alternatively, the `--noinform` option turns off the startup banner.
You can then change the prompt to the empty string by setting the SBCL-specific `sb-aclrepl:*prompt*` variable. To access this, you need
to `require` the `sb-aclrepl` package. To avoid spurious output, this
can all be done with `--eval` options on the command line:
raE
%%script sbcl --noinform --eval "(require 'sb-aclrepl)" --eval "(setq sb-aclrepl:*prompt* \"\")"
(+ 2 2)
raA
4
Gets a bit complicated, but at least itrCOs not always necessary ...
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 56:27:42 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,806 |