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
8
votes
2 answers

cl-opengl under SLIME on MacOS crashing SBCL... bug?

I'd like to do some OpenGL programming in Common Lisp, under Emacs and SLIME. I'm not set on it, but I'm currently trying to use SBCL. If I open up emacs from the start, create a new file with just this one line: (ql:quickload :cl-opengl) And…
lindes
  • 9,854
  • 3
  • 33
  • 45
8
votes
3 answers

Redefine generic function with different lambda list

I've made a mistake and forgot to specify keyword arguments in defgeneric the first time I've compiled it. Now I really don't want to restart SLIME only to redefine this one defgeneric to include more arguments. Is there a way to "undefine" it…
user797257
8
votes
4 answers

Common Lisp: Why does my tail-recursive function cause a stack overflow?

I have a problem in understanding the performance of a Common Lisp function (I am still a novice). I have two versions of this function, which simply computes the sum of all integers up to a given n. Non-tail-recursive version: (defun addup3 (n) …
oarfish
  • 4,116
  • 4
  • 37
  • 66
8
votes
3 answers

How to make Lisp forget about previously exported symbols?

This is how I export symbols :bar and :baz from package foo: (in-package :cl-user) (defpackage foo (:use :cl) (:export :bar :baz)) (in-package :foo) When I remove :baz from the list of exported symbols SBCL complains and the compilation…
Jan Deinhard
  • 19,645
  • 24
  • 81
  • 137
7
votes
1 answer

Efficient vector operations of linear algebra in Common Lisp, especially SBCL?

The Program below seems very inefficient. It takes as much as 28.980 GC time, in contrast 6.361 sec non-GC time, with SBCL 1.0.53. (deftype vec3 () '(simple-array double-float (3))) (declaim (inline make-vec3 vec3-zero vec3-x vec3-y…
masayuki takagi
  • 442
  • 3
  • 12
7
votes
2 answers

Why is SBCL complaining about setf?

In SBCL, this will assign 'bar to foo, with warnings: * (setf foo 'bar) ; in: SETF FOO ; (SETF FOO 'BAR) ; ==> ; (SETQ FOO 'BAR) ; ; caught WARNING: ; undefined variable: COMMON-LISP-USER::FOO ; ; compilation unit finished ; Undefined…
7
votes
4 answers

Enabling autocomplete in sbcl

I have recently started to learn lisp, and have mainly bin using clisp and vim. I wanted to try sbcl as well, since this is often recommended as one of the best, free lisp compilers. There is one thing, though, which makes sbcl more difficult to use…
Karl Yngve Lervåg
  • 1,714
  • 3
  • 18
  • 34
7
votes
0 answers

Calling Haskell from Common Lisp (SBCL)

I am trying to call Haskell (ghc version 7.6.3) from Common Lisp (sbcl version 1.2.4) on a debian pc. The Haskell code is {-# LANGUAGE ForeignFunctionInterface #-} module Safe where import Foreign.C.Types fibonacci :: Int -> Int fibonacci n =…
Dimitris
  • 151
  • 9
7
votes
3 answers

Common Lisp Error Not Understood

I'm trying to write a number guessing game in Lisp as a time-killing project. However, when I try to load up the program using SBCL, I get the following error: debugger invoked on a SB-C::INPUT-ERROR-IN-COMPILE-FILE in thread #
Andy
  • 3,132
  • 4
  • 36
  • 68
7
votes
1 answer

How to see doc string for a defparameter, defconstant, or defvar?

Using common lisp you can add many docs strings for example: CL-USER> (defun foo () "doc string for foo" nil) FOO CL-USER> (documentation 'foo 'function) "doc string for foo" CL-USER> (describe 'foo) COMMON-LISP-USER::FOO …
anquegi
  • 11,125
  • 4
  • 51
  • 67
7
votes
2 answers

How big is a class in memory?

How do I figure out how many bytes a defclass object has in Common Lisp?
Paul Nathan
  • 39,638
  • 28
  • 112
  • 212
7
votes
1 answer

Loading a file in common lisp

I've been learning/playing around with common lisp for some time(few months), and I still have some difficulty understanding how to import code from other files. I'm using emacs/slime and SBCL, and from what I've read, I need to use the "load"…
Charles Langlois
  • 4,198
  • 4
  • 16
  • 25
7
votes
2 answers

Stepping in sbcl from within the debugger

I am trying to figure out how to step through code in sbcl and Slime after invoking the debugger with something like break. I do not want to have to start stepping from the beginning. For example if I have the following code: (defun fib (n) (when…
malisper
  • 1,671
  • 1
  • 12
  • 16
7
votes
2 answers

How do I memory map tmpfs files in sbcl?

Exactly as the question says. I want to use shared memory to communicate between two lisp processes. Any pointers on how to do that? I can see some tutorials on doing this in clozure at :- http://ccl.clozure.com/manual/chapter4.7.html Can someone…
owagh
  • 3,428
  • 2
  • 31
  • 53
7
votes
1 answer

CLOS make-instance is really slow and causes heap exhaustion in SBCL

I'm writing an multiarchitecture assembler/disassembler in Common Lisp (SBCL 1.1.5 in 64-bit Debian GNU/Linux), currently the assembler produces correct code for a subset of x86-64. For assembling x86-64 assembly code I use a hash table in which…
nrz
  • 10,435
  • 4
  • 39
  • 71