15 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
Advice
2
votes
16
replies
211
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 ...
1
vote
3
answers
685
views
Are (let) and (lambda) equivalent in Common Lisp
I'm reading On Lisp by Paul Graham, trying to better understand the functional style of programming. In Chapter 3, he mentions that functional programs "work by returning values" rather than ...
1
vote
1
answer
303
views
Tail-recursive flatten function in Emacs Lisp
I'm going through Paul Graham's On Lisp, and trying to implement the functions in Emacs Lisp.
One of them is flatten :
(flatten '(a (b c) ((d e) f)))
;; Returns:
(a b c d e f)
Yet for some reason, ...
3
votes
1
answer
189
views
"On Lisp": `(a b c) vs '(a b c) vs (list 'a 'b 'c)
In On Lisp (p. 84) Graham says
‘(a b c) (without comma) is equal to ’(a b c)
and then says
A backquoted list is equivalent to a call to list with the elements
quoted.That is, ‘(a b c) (without ...
0
votes
3
answers
127
views
Difference between (apply #'somefunc args) and (somefunc args)
While reading Paul Graham's On Lisp I found the following function in Chapter 4, Utility Functions.
(defun symb (&rest args)
(values (intern (apply #'mkstr args)))) ;; mkstr function is "...
3
votes
1
answer
153
views
about the Prolog implementation
I just want to add the capability to handle lisp query into the initial Prolog implementation in OnLisp text.
Since this capability is introduced in the following chapater (a new implementation), I ...
0
votes
1
answer
105
views
regarding continuation in OnLisp
I am still interested in the question which has been answered.
continuation in common lisp by macros — regarding an implemetation in OnLisp
What will happen if Paul Graham's assumption is correct ...
2
votes
4
answers
7k
views
Flatten a list using common lisp
I was reading the book On Lisp by Paul Graham. In Chapter 4, Utility Functions, he gives examples of small functions that operate on lists, which would be helpful while writing a larger program.
One ...
3
votes
1
answer
763
views
Is this really a breadth first search
There is a piece of pseudo code of a breadth first search on P.303 of OnLisp which is show below.
For the graph below, it will first process node 1, and then put node 2, 3 and 4 into the queue and ...
1
vote
1
answer
75
views
Is this a good correction for "our-find-if" at Graham's OnLisp page 23 errata?
Paul Graham's 'On Lisp' errata page states:
p. 23. our-find-if would recurse infinitely if no element matches. Caught by Markus Triska.
The function definition as shown in the book is:
(defun our-...
5
votes
1
answer
1k
views
continuation in common lisp by macros -- regarding an implemetation in OnLisp
In On Lisp, p. 267, Paul Graham provides an implementation of continuation passing macros:
(setq *cont* #'identity)
(defmacro =lambda (parms &body body)
`#'(lambda (*cont* ,@parms) ,@body))
(...
3
votes
1
answer
158
views
The necessity of quote in On Lisp's #[ read macro?
I am reading On Lisp and cannot make out why the code below has use a quote. Here is the excerpt from the text:
Another character combination reserved for the user is #[. Figure 17.3
gives an ...
13
votes
1
answer
356
views
Bizarre quoted list example from On Lisp
This passage from On Lisp is genuinely confusing -- it is not clear how returning a quoted list such as '(oh my) can actually alter how the function behaves in the future: won't the returned list be ...
14
votes
3
answers
613
views
Strange Lisp Quoting scenario - Graham's On Lisp, page 37
I'm working my way through Graham's book "On Lisp" and can't understand the following example at page 37:
If we define exclaim so that its return value
incorporates a quoted list,
(defun exclaim (...
4
votes
2
answers
1k
views
Learn Macros in Scheme from On Lisp [closed]
I really want to learn Scheme macros. I glanced over the content of "On Lisp" and a lot of the chapters have been devoted to Lisp macros. However I do not know common lisp. Can I use it to learn ...