6,427 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
58
views
How to use with-safe-io-syntax?
I'm reading a file with
uiop:read-file-lines
The documentation says: beware: be sure to use with-safe-io-syntax, or some variant thereof
This is what I tried:
(defun sample-input
()
(uiop:with-...
Tooling
0
votes
0
replies
49
views
How to get started with slimv in neovim?
I have created a plugin for lazy:
.config/nvim/lua/plugins/slimv.lua:
return {
"kovisoft/slimv"
}
Now, how do I start a REPL in neovim?
I have also created a minimal common lisp file:
...
2
votes
1
answer
88
views
I get one return value from the REPL and another from the file in Common Lisp. Why?
When I use the REPL I get this result:
* (block my-block
(print "We see this")
(return-from my-block 10)
(print "We will never see this"))
"We see this"
10
*
...
Advice
0
votes
8
replies
101
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 ...
2
votes
1
answer
108
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
64
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
64
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
68
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
86
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
2
votes
16
replies
210
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
249
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
84
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 ...
3
votes
4
answers
147
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
35
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
186
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 ...