Questions tagged [sbcl]

Steel Bank Common Lisp: an open-source compiler and runtime implementation of ANSI Common Lisp.

SBCL is an open-source implementation of ANSI Common Lisp (1994), the Common Lisp standard. It runs on Linux, FreeBSD and variants, MAC OS X, and recently on Windows (x64 support in progress). It features unicode support, native interface to C libraries (UFFI), threading (Windows support not official yet), and a native compiler.

849 questions
10
votes
2 answers

In Common Lisp why does the macro OR use a gensym, but not AND?

In Common Lisp (SBCL 1.0.58) why does the macro OR use a gensym, but not AND? For example, CL-USER> (macroexpand '(and 1 2 3 4 5)) (IF 1 (AND 2 3 4 5) NIL) T CL-USER> (macroexpand '(or 1 2 3 4 5)) (LET ((#:G967…
kes
  • 359
  • 1
  • 8
9
votes
2 answers

How to set SBCL's current directory using slime?

In the past, i use the following script to start SBCL: breakchars="(){}[],^%$#@\"\";:''|\\" cd /media/E/work exec rlwrap --remember -c -b "$breakchars" -f "$HOME"/.sbcl_completions sbcl --noinform --userinit "$HOME"/.sbclrc "$@" Now when using…
z_axis
  • 8,272
  • 7
  • 41
  • 61
9
votes
1 answer

Help using Lisp debugger

I'm trying understand how to interpret the output of, and use, the Lisp debugger. I've got a pretty simple Backtrace for the evaluation of my function, but I cann't seem to work out how to use it to find out in which Lisp 'form' in my function the…
Joel
  • 29,538
  • 35
  • 110
  • 138
9
votes
1 answer

Maximum debug info from Steel Bank Common Lisp & Slime

What's the best way to initialise a Lisp session (I'm using Slime and sbcl) such that functions are always compiled with the maximum amount of debug information?
Joel
  • 29,538
  • 35
  • 110
  • 138
9
votes
2 answers

SBCL changes EQness of a local bound function object, even though it is not set?

Given this example code (from a Reddit /r/lisp question): (defun next (pos) (nth (1+ pos) '(0 1 2 3 4 5 6 7 8 9 10))) (defvar *next* (function next)) (let ((old-next #'next) (previous (make-hash-table))) (format t "~% 1 EQ? ~a"…
Rainer Joswig
  • 136,269
  • 10
  • 221
  • 346
9
votes
2 answers

SBCL: asdf:load-system fails when a string constant is defined

Using SBCL, I have the problem that my system defined via ASDF does not load, when the lisp code defines a string constant. Here's the code: constants.lisp (defconstant A 1.0) (defconstant B "B") simple.asd (defsystem :simple :components ((:file…
Ollimaus
  • 207
  • 1
  • 6
9
votes
1 answer

Jupyter and Common Lisp

I'm trying to install cl-jupyter (A common-lisp kernel for Jupyter), and I can't make it work: when I open a new lisp notebook (or change the kernel of an existing notebook), it crashes after displaying the following messages: [I 18:26:50.855…
Borbei
  • 219
  • 3
  • 7
9
votes
3 answers

Long integer to string and vice versa, operation with digits

Solving the Euler project problems I get that I need to make operations with the digits of a long number normally as a string. I work in linux, emacs, slime with sbcl. For example, to get the sum of the digits of this power 2¹⁰⁰⁰, I work this way,…
anquegi
  • 11,125
  • 4
  • 51
  • 67
9
votes
8 answers

Does Common Lisp have a something like java's Set Interface/implementing classes?

I need something like this, a collection of elements which contains no duplicates of any element. Does Common Lisp, specifically SBCL, have any thing like this?
Paul Wicks
  • 62,960
  • 55
  • 119
  • 146
9
votes
1 answer

Proper way of defining packages using asdf:defsystem and quickproject

I'm a Lisp beginner trying to understand how to properly use Lisp package system while learning LTK for GUI programming, using SBCL 1.0.55.0.debian and Limp 0.3.4 (and Debian Wheezy if that matters). I have installed ASDF using aptitude package…
nrz
  • 10,435
  • 4
  • 39
  • 71
8
votes
2 answers

SBCL Switches print and read order (lisp)

I'm still learning lisp, so, when I came across this problem, it confused me. I have a simple function where I want to print first and then read the input: (defun ask() (princ '?) (read)) So, when I ran this with CLISP, it showed what was…
DJM
  • 103
  • 1
  • 4
8
votes
3 answers

Saving SBCL Image From Emacs Multiple Threads Error

I have been playing with saving running Common Lisp images to save time upon restart and make the development more efficient. However, I am having a bit of a problem since when I run the following command in the…
MadPhysicist
  • 5,401
  • 11
  • 42
  • 107
8
votes
2 answers

Matrix multiplication in Common Lisp

I am writing the program in CL (with SBCL 1.2.15) that uses linear algebra. During the course of execution, it often multiplies a matrix by a vector. Profiler showed that most of the time (80%) the program spends doing exactly that, multiplying…
mobiuseng
  • 2,326
  • 1
  • 16
  • 30
8
votes
3 answers

Defining aliases to standard Common Lisp functions?

Lisp is said to enable redefinitions of its core functions. I want to define an alias to the function cl:documentation function, such that (doc 'write 'function) === (documentation 'write 'function) How can this be done and made permanent in SBCL?
sjas
  • 18,644
  • 14
  • 87
  • 92
8
votes
3 answers

Cross-compiling with SBCL

I have SBCL running on a Ubuntu machine. I want to write a little program that I want to give to a friend who has only Windows running. What is the quickest way to cross-compile it on my machine into a "standalone" windows program (i.e. the usual…
Svante
  • 50,694
  • 11
  • 78
  • 122