24 questions
1
vote
2
answers
190
views
How do I ask a CommonLisp system to lookup symbols dynamically at runtime in compiled functions?
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 ...
1
vote
1
answer
140
views
How does Common Lisp represent control modifiers for character keys?
According to CLTL2, all of functions that deal with key modifiers seem to be removed from the standard. SBCL does not seem to have any of those.
What is the printing representation of characters with ...
2
votes
1
answer
53
views
(rassoc) returns NIL on nested list when (find) does not
I want to perform (rassoc) over a nested list like this:
(setq mlist
(list (list (cons "A" 0)
(make-hash-table))
(list (cons "B" 1)
(...
3
votes
0
answers
247
views
Recommended way to deal with cross-platform file paths with support for URLs?
I'm not new to Lisp but new to CL and a bit confused by the file and directory path handling. What I need: A completely cross-platform way to deal with file and directory paths that can be specified ...
0
votes
1
answer
128
views
Recursive function traversing a string to found the closing bracket of a give opening bracket
I was trying make a function that return the closing bracket of a given opening bracket, I already can do this, but in my first attempt I can't understand where is my error, and I would like know to ...
1
vote
4
answers
335
views
Is there a way to use iteration in Common Lisp and avoid side-effects at the same time?
I've written two versions of a lisp function. The main difference between the two is that one is done with recursion, while the other is done with iteration.
Here's the recursive version (no side ...
0
votes
1
answer
898
views
Special Declaration and Variables in Common Lisp [duplicate]
I am reading the Common Lisp Hyperspec and am struggling to understand the concept behind the Special declaration.
Namely, what are the special variables and why would we want them? I gathered that ...
0
votes
1
answer
937
views
Defining functions Scheme-style in Common Lisp, without defun
In Scheme, you define functions like
(define f (lambda (x) ...))
In particular, you can do something like this
(define f (g))
where g is some function returning a function. Is it possible to do the ...
4
votes
1
answer
833
views
how to define and call class methods in common lisp / CLOS
I'd like to define methods on class objects, that inherit based upon the class' ancestry in the same way that instances' methods inherit. Is there some way to do this?
Here's what's not working: eql-...
3
votes
2
answers
841
views
Lisp good practices
I've started studying Lisp 2 days ago and I'm reading Paul Graham's ANSI Common List, which exposes the language structure in a very interesting way. It's not too much theoretical for beginners, and ...
3
votes
1
answer
295
views
Does #'adjoin in Common Lisp work as per HyperSpec when used with `:key`?
Looking at the docs for #'adjoin in the HyperSpec, I see the following in the Examples section:
(setq slist '()) => NIL
(setq slist (adjoin '(test-item 1) slist)) => ((TEST-ITEM 1))
(adjoin '(...
-2
votes
4
answers
160
views
a function in lisp called xtoy which returns a list from x to y
I am very new to lisp. I am trying to write a function named x2y which takes 2 arguments x and y which are integers and return a list of integers which starts from x and ends at y
(defun xtoy (X Y)
...