Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
0 answers
63 views

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 ...
Patrick Donegan's user avatar
2 votes
0 answers
44 views

I am implementing circular evaluator in Chapter 4 SICP with racket, it seems that the code running fine only it cannot add new frames to the environment due to set-car! issue. I tried the followings: ...
QianruZhou's user avatar
Advice
1 vote
16 replies
197 views

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 ...
dhnam's user avatar
  • 163
1 vote
1 answer
74 views

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 ...
user31676144's user avatar
0 votes
1 answer
57 views

I’ve been reading about Lisp programming languages and trying to understand the core difference between macros and regular functions. From what I gather, Lisp’s macro system allows developers to ...
Mike Pyskin's user avatar
0 votes
2 answers
56 views

If I want to make a special-form conditional (making its value depend on a condition) in an expression like (FUNC ARGS) by making FUNC a conditional expression (if). I ended up trying with something ...
vmonteco's user avatar
  • 15.9k
0 votes
1 answer
57 views

Shadow-cljs has a resource loader that can include literal files into the Clojurescript code (ns app.my (:require [shadow.resource :as rc])) (rc/inline "file.txt") I need a macro that ...
user2649762's user avatar
2 votes
1 answer
170 views

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 ...
Iñaki Viggers's user avatar
-1 votes
1 answer
101 views

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 ...
Ashley Ben Story's user avatar
1 vote
3 answers
135 views

I wrote a simple intersection function on two lists: (define (intersection l1 l2) (if (null? l1) '() (if (member (car l1) l2) (cons (car l1) (intersection (cdr l1) l2)) (...
david's user avatar
  • 1,593
1 vote
1 answer
88 views

I'm using Emacs, and I have a macro that's like a switch for regexes, and runs an expression with variables bound to match results. The indentation isn't what I'd like but I can't find if there's a ...
John Graham's user avatar
2 votes
1 answer
74 views

I don't know if I am clear in the title, but here me out. I have a package in which I bind *read-default-float-format* to 'double-float. So far so good. When I load the library into fresh SBCL process ...
myname's user avatar
  • 368
3 votes
2 answers
73 views

With this: (defclass test-class () ((data :initarg :data) (other :initarg :other))) (defmethod test ((tc test-class) &key) (macrolet ((print-slot (slot) `(with-slots (,slot) ...
John Graham's user avatar
1 vote
2 answers
126 views

I have a class, in which I want some slots to be nil when object is created, but they should be only setable with objects of some certain type. Something like: (defclass Something () ((foo :initarg :...
myname's user avatar
  • 368
1 vote
1 answer
128 views

I'm learning syntax-case macro system. This is what I have so far: (define-syntax loop (lambda (x) (syntax-case x () [(_ (var val x ...) body) (with-syntax ([recur (datum->syntax ...
jcubic's user avatar
  • 67.1k
0 votes
1 answer
67 views

I noticed that both compile-bundle-op and monolithic-compile-bundle-op work as expected on traditional projects. That is, generating the FASL files: # compile-bundle-op FASL <asdf-fasl-project-...
Sebastian Carlos's user avatar
1 vote
1 answer
64 views

Suppose I'm setting a var like this: (setq var '((:item1 "stringA") (:item2 "stringB"))) (this works) Now I would like "stringA" be a conditional, like this: (setq var '(...
Alexander Shcheblikin's user avatar
1 vote
1 answer
105 views

I've noticed an interesting difference between WITH-SLOTS and WITH-ACCESSORS in Common Lisp: WITH-SLOTS allows a shorthand syntax: (with-slots (slot1 (var-name slot2)) instance ...) But WITH-...
Sebastian Carlos's user avatar
-1 votes
2 answers
112 views

I've never used LISP before and I'm using AI to try to create simple automations for autocad so I can speedup the proccess. Everything works fine to the point where I have a let expression which takes ...
user29889914's user avatar
2 votes
2 answers
113 views

Thanks in advance for the help! Here's the situation: I want to capitalize the first word in a sentence. I have the individual words in a sentence, stored as strings. In the case of the first word, I ...
Oliver Cox's user avatar
0 votes
3 answers
92 views

I have been learning Common Lisp for a short while, using the SBCL 2.0.0 REPL on a Windows 10 machine. At one point in time I inputted the 2 following lines into a REPL: (defvar var-string (print (* 5 ...
Ashley Ben Story's user avatar
1 vote
3 answers
85 views

Working in AutoLISP. I am looking for a more elegant way to extract the second string in this list of lists... (("FullName") ("Larry Paige")) Currently using the following to ...
Kyle Fleming's user avatar
1 vote
1 answer
140 views

(Edit 2025-02-27: I should note that there isn’t a difference between how CLISP and SBCL handle this situation the way I initially thought there was; see the comments to this question, and the answer ...
Tina Russell's user avatar
0 votes
1 answer
122 views

I have created a search function following the BFS algorithm but found a problem, it works fine on other problem domains but on this problem domain I am only getting stack overflows. This specific ...
hrodric's user avatar
  • 435
0 votes
1 answer
213 views

I work with lots of rectangles(POLYLINE) with an ID name(TEXT) inside them. I need to separate each Recatngles by Layer depending on their ID name. So to make things a bit easier, I want to be able to ...
Joseph Romero's user avatar
1 vote
1 answer
82 views

I try this LISP snippet from the Structure and Interpretation book (define (a-plus-abs-b a b) ((if (> b 0) + -) a b)) in emacs by C-x C-e, or by evaluating the whole buffer. either way and get ...
Stephen's user avatar
  • 624
0 votes
1 answer
56 views

Does a Lisp or Scheme cons bear any similarities or theoretical kinship to a dot product? In the Lisp family (cons 1 2) produces (1 . 2) which looks a lot like a dot product. Just coincidence?
147pm's user avatar
  • 2,289
0 votes
1 answer
113 views

When interfacing with C libraries, in this case win32 in particular, there may be a large number of defined constants. In a C/C++ program these are just literal numbers when compiler sees them, the ...
myname's user avatar
  • 368
7 votes
1 answer
408 views

Consider the following Common Lisp code. (print (let* ((x nil) (y x)) (setq x t) (and y x))) ; T (print (let* ((x nil) (y x)) (setq x t) (and x y))) ; NIL (print (let* ((x nil) (y t)) (setq y x) (...
single-question-123's user avatar
0 votes
0 answers
49 views

This code works when launched like this: clisp test.lisp ;;contents of test.lisp file (defun wtof (filename text) "Append TEXT to the file specified by FILENAME." (with-open-file (stream ...
nadirkazan's user avatar
1 vote
1 answer
133 views

Inspired by a post on Reddit (someone wanted to count frequencies in commonlisp forum), I wanted to write a list-based one for the fun and practice, hash-based one is of course more efficient. I got ...
myname's user avatar
  • 368
0 votes
0 answers
76 views

(defun creer-bagage (=poids =categorie) (let* ((timestamp (get-universal-time)) (=id (format nil "~8d" (mod timestamp 100000000))) (=dimensions (case =...
Johan Tchassem's user avatar
1 vote
1 answer
87 views

Solving a challenge in www.codewars.com. It uses sbcl and rove for testing the answers. I want to translate a string to a symbol. Codewars requires code inside a package to see it. This is a sample (...
xvan's user avatar
  • 4,849
1 vote
3 answers
180 views

I'm having some troubles with Common Lisp. I want to do a code to find how many times the values of a list are over or under two limits. I want to do a sweep on a list and evaluate if the current ...
M1ctl4nt3cutl1's user avatar
2 votes
1 answer
97 views

I'm new on lisp and I'm trying to solve some basic exercises. I'm trying to make a list of elements in an input list that are out of max and min limits. I've been trying to do this by creating two ...
M1ctl4nt3cutl1's user avatar
2 votes
1 answer
76 views

I'm new on lisp and I'm finding a difficulty while working with "append". I have to reorder a list and put the first element of the input list as the last of the output list. I've trying ...
M1ctl4nt3cutl1's user avatar
0 votes
0 answers
76 views

I am trying to use Dog Hoyte's Let over Lambda, Chapter 3, named let with some touch from EmacsLisp (named-let from subr-x.el). Neither his original, nor mine slightly modified version macroexpand in ...
myname's user avatar
  • 368
0 votes
2 answers
135 views

So in Lisp/Scheme, there are these 'symbols', which are basically, if I understand correctly, and correct me if I'm wrong, references to variables (not their values). I was wondering if there's a ...
JorensM's user avatar
  • 510
3 votes
2 answers
101 views

As the title says, how do I (programmatically) check in a portable way (if possible) if a symbol stands for a symbol-macro? CL-USER> (define-symbol-macro some-macro some) SOME-MACRO CL-USER> (...
myname's user avatar
  • 368
1 vote
2 answers
85 views

This is from this CS 61A notes about SICP p80~82 about ucblogo (a dialect of Logo, which derived from Lisp): Second, Logo has first-class expressions; you can run a list that you get as an argument. ...
An5Drama's user avatar
  • 774
4 votes
2 answers
116 views

So I'm studying systems engineering and we're currently going over different programming paradigms. We started playing with functional programming last class and we were asked to code a recursive '...
Franco Moreno's user avatar
0 votes
1 answer
76 views

I started playing with some hobby webdev project in Common Lisp. For DB access I'm planning on using mito and sxql. I'm trying to find out if I need to do any additional stuff to protect myself from ...
pbm's user avatar
  • 378
0 votes
0 answers
125 views

I have just upgraded to SBCL 1.4.3, and I'm having trouble loading foreign libraries while loading my package with Quicklisp. Everything worked before the upgrade. I get this error: (CFFI::FL-ERROR &...
Oliver Cox's user avatar
2 votes
1 answer
200 views

How does recursive tail call optimization work in regards to what is placed/removed from the call stack? Specifically for LISP like languages? Any insight at assembly level will be helpful. I show ...
notaorb's user avatar
  • 2,210
0 votes
1 answer
131 views

This seems like an obvious question but my Googling suggests the answer is no, which I find hard to believe. I'm just starting out using examples from textbooks, and get the following. I have to type &...
Sridhar Sarnobat's user avatar
4 votes
2 answers
114 views

It appears that the Kate editor has a lot of xml files describing various languages, for highlighting purposes. For example, commonlisp.xml contains all 978 standard Common Lisp symbols. Other ...
coredump's user avatar
  • 39.4k
2 votes
1 answer
77 views

I am a beginner lisp programmer, and I'm following the Practical Common Lisp book, specifically chapter 9. After finishing the chapter, I've tried to expand the unit-testing environment. Specifically, ...
banana bajanana's user avatar
1 vote
2 answers
193 views

As a preamble, I am implementing two simple commands I can use via a little package in SBCL, which emulates Allegro repl. The package is sb-aclrepl, found in the contrib folder in SBCL sources. The ...
myname's user avatar
  • 368
0 votes
2 answers
107 views

I have a question, whether this is intended by the language or whether this is kind of an unexpected/unwanted behavior/ BUG in Common Lisp. However, I observed it in both: CLISP and SBCL: I thought, (...
Gwang-Jin Kim's user avatar
2 votes
3 answers
415 views

Let's say there is a web application running on a VPS with Linux as a systemd service, or whatever is best for it. Is it possible to access the running Lisp image with a new REPL instance or somehow ...
Alteration Dream's user avatar

1
2 3 4 5
141