6,425 questions
Advice
0 votes
4 replies
37 views
Adding an element to list inside a function
Lisp beginner. I am trying to add an element to a list inside a function. (defun add-element (e lst) (setf lst (cons e lst))) I cannot use the return of the function to change the original list but ...
-1 votes
0 answers
57 views
Euler problem 1 Common Lisp recursive solution not working [closed]
I just started playing around with Common Lisp and tried the first euler problem which states to sum all the divisors of 3 OR 5 under some given parameter x. I would like to use a recursive solution ...
2 votes
1 answer
80 views
Common Lisp step-by-step debugging with SBCL and SLIME
I tried to debug the function below (find-3rd-largest), and wanted to execute expressions step by step from (break), as I did for other programming languages. So, I compiled the function with C-u C-c ...
Advice
2 votes
2 replies
55 views
writing nicely a list of lists on disc SBCL
In a package I am developing I often get lists of lists. The single lists are very long and I would like to write them on a file controlling the output length as in the example. If I simply use (write ...
0 votes
1 answer
60 views
Why Common Lisp warns about unknown keyword argument in some cases but not others?
I am trying to understand why when I declare types, things seem to go very wrong in SBCL. Here's a little file I created to reproduce the problem: (defpackage p1 (:use :cl) (:export #:do-it #:keytype))...
-1 votes
1 answer
57 views
CL-CFFI-GTK: Is there a way to avoid FLOATING-POINT-INVALID-OPERATION?
About three years ago I tried to follow the GTK3 tutorial for Common Lisp. I had different problems then, but many of the examples worked without any complains. Now I took the time to reconsider it, ...
2 votes
0 answers
74 views
Avoid compiler warnings linked to double-float boxing/unboxing in SBCL Common Lisp
When I compile (with (speed 3)) the following (example) code with SBCL Common Lisp, the compiler issues this warning in relation with function triple returning a double-float: "doing float to ...
Advice
1 vote
16 replies
197 views
In Common Lisp, replacing "get-setf-method" with "get-setf-expansion" is not always working
The sortf function from Chapter 12 of the book "On Lisp" originally used get-setf-method, which is currently unavailable in a recent SBCL by default. Therefore, get-setf-expansion was used ...
3 votes
3 answers
234 views
Performance issues with reading lines from *standard-input*
I need to process 100 Gigabytes of logs in a weird format, then do some analysis on the results. Initial parts of parsing and CLI done, tried on some test data with 1 GB and it took around a minute. I ...
1 vote
1 answer
73 views
OpenBLAS gemm 2x slower in Lisp CFFI compared to direct C calls with same BLAS library
I'm experiencing a significant performance difference where OpenBLAS matrix multiplication runs 2x slower when called through Lisp CFFI compared to direct C calls, despite using the exact same ...
2 votes
3 answers
115 views
Can a symbol be aliased in Common Lisp?
Context In Common Lisp, symbols are how names are bound to functions and variables and macros and a bunch of other stuff. I've been working with Parenscript, which is a DSL that compiles to Javascript....
1 vote
1 answer
33 views
Common Lisp: SWANK::*READTABLE-ALIST* is unbound
While working on the REPL I didn't encounter this error, but when building my program or running it from sources I did: SWANK::*READTABLE-ALIST* is unbound
2 votes
1 answer
169 views
How do I measure performance of Lisp code?
I'm trying to discern how much performance gains I would achieve by converting Lisp (SBCL) code to assembly language. The time function on SBCL keeps giving counterintuitive results even for trivial ...
5 votes
2 answers
268 views
Signal handling in multi-threaded scenario [closed]
I'm trying to revive Hemlock, which now appears abandoned (original author has been absent for some time now). Mostly this has been a straightforward process of clearing out the bit rot, but I'm now ...
-1 votes
1 answer
101 views
I can't see why Steel-Bank Common Lisp thinks a string is a function in my code [closed]
I am using a Windows 11 computer, running Steel Bank Common Lisp (version 2.0.0) in PowerShell by inputting functions directly into the SBCL.exe REPL to see if they work. In the process, I have hit ...