Questions tagged [let-over-lambda]
6 questions
9
votes
3 answers
Macros That Write Macros - Compile Error
When I compile the following code, SBCL complains that g!-unit-value and g!-unit are undefined. I'm not sure how to debug this. As far as I can tell, flatten is failing.
When flatten reaches the unquoted part of defunits, it seems like the entire…

SpyroSoft
- 233
- 1
- 10
4
votes
2 answers
let-over-lambda in Scheme?
In Common Lisp, if I want two functions to share state, I would perform a let over lambda as follows:
(let ((state 1))
(defun inc-state ()
(incf state))
(defun print-state ()
(format t "~a~%" state))
These functions are not local to the let -…

Sod Almighty
- 1,768
- 1
- 16
- 29
2
votes
1 answer
Where is 'a1' bound in sortf from the book Let over Lambda?
The book "Let over Lambda" by Doug Hoyte describes a fast sorting function for fixed sized inputs via sorting networks:
(defmacro! sortf (comperator &rest places)
(if places
`(tagbody
,@(mapcar
#`(let ((,g!a #1=,(nth (car a1)…

Kasper van den Berg
- 8,951
- 4
- 48
- 70
1
vote
1 answer
let over lambda doesn't seem to work in elisp
In Common Lisp this sort of thing works fine
(let ((x 7))
(defun g (y) (* y x)))
(g 16)
In elisp this errors saying x is not defined as if the lexical closure did not happen. This is something I have not encountered in other lisps. What is…

Samantha Atkins
- 658
- 4
- 12
1
vote
2 answers
How can the symbols in a Pandoric Macro be compiled out?
I have read section 6.7 of LOL a few times now, and I still can't wrap my mind around the following.
Bindings that were previously closed to outside code are now wide open for us to tinker with, even if those bindings were compiled to something…

Todd
- 475
- 4
- 15
1
vote
1 answer
common lisp: how to run let-over-lambda tests
I am using the example of Doug Hoyte's and The Phoeron's let-over-lambda to simultaneously build up my understanding of common-lisp packages, of quicklisp and asdf, and of production-level, professional practices for programming at scale in common…

Reb.Cabin
- 5,426
- 3
- 35
- 64