15 questions
Advice
1
vote
16
replies
191
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
1
answer
300
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, ...
0
votes
3
answers
126
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 "...
0
votes
1
answer
95
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 ...
3
votes
1
answer
755
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 ...
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))
(...
13
votes
1
answer
350
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 ...
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 ...