(define (qq-expand x)
(cond ((tag-comma? x)
(tag-data x))
((tag-comma-atsign? x)
(error "Illegal"))
((tag-backquote? x)
(qq-expand (qq-expand (tag-data x))))
((pair? x)
`(append ,(qq-expand-list (car x))
,(qq-expand (cdr x))))
(else '', x)))
(define (qq-expand-list x)
(cond ((tag-comma? x)
`(list ,(tag-data x)))
((tag-comma-atsign? x)
(tag-data x))
((tag-backquote? x)
(qq-expand-list (qq-expand (tag-data x))))
((pair? x)
`(list (append ,(qq-expand-list (car x))
,(qq-expand (cdr x)))))
(else ''(,x))))
Tuesday, July 27, 2010
quasiquote for primitive lisp
I was searching for a basic quasiquote implementation in lisp which mentioned a paper by Alan Bawden. Anyway it was difficult to find via google so I figured I would type it up here for posterity. The original paper can be found: here.
Subscribe to:
Post Comments (Atom)
Blog Archive
-
►
2008
(26)
-
►
December
(12)
- templating dsl
- nodes relating to nodes to relate to nodes
- collections of collections and relations of relati...
- On Authors and Hackers
- initial impressions of seaside
- trying to put my finger on it
- lisp+smalltalk+php ?
- more on syntax
- philosophy of duality of syntax
- duality of syntax
- more on let blocks
- closures in php
-
►
December
(12)
0 comments:
Post a Comment