[cl-quasi-quote-devel] Help Getting Started with Quasiquote

Elliott Slaughter elliottslaughter at gmail.com
Mon May 26 19:08:09 UTC 2008


On Mon, May 26, 2008 at 2:05 AM, Attila Lendvai
<attila.lendvai at gmail.com> wrote:
>> I am attempting to write a macro which implicitly backquotes its
>> arguments. After asking around a bit, I was directed to cl-quasi-quote
>> as a possible solution to my problem. I have installed cl-quasi-quote,
>> but am having a little trouble figuring out how to use the library,
>> since all the examples seem to involve transforming a Lisp to some
>> other language, which isn't really what I want to do. So my question
>
> currently our goal is to transform some other languages to lisp. more
> precisely: to lisp forms that emit the other language when executed.
> the languages we need now: xml, js, and sql (but cl-rdbms already has
> a half-assed version, so it works for now)

Ok, that's what I thought from looking at the your project page, but
the name made me think perhaps you had a portable implementation of
backquote.

>> is, how would you use cl-quasi-quote to write just a basic macro
>> wrapping an expression in a quasi-quote? (Its a trivial example, but
>> if I can figure this one out I should be able to do what I want in my
>> project.)
>
>
> i'm not sure what you want, but maybe you should take a look at
> alexandria:once-only or similar macros. posting an example would help,
> too.

I am trying to something along the lines of the following, which works
unportably on CLISP.

[1]> (defvar x 'a)
X
[2]> (defmacro wrap (expr) (list 'system::backquote expr))
WRAP
[2]> (wrap x)
X
[4]> (wrap (system::unquote x))
A

Except I'd also like to do

[6]> (wrap ,x)

which currently fails on CLISP because of read-time checks (the
backquote doesn't appear in the form until macro-expansion time, which
isn't early enough to make the reader happy).

> if you really need read-time stuff, then there's a lisp.lisp in cl-qq,
> which is (or better, should be) a simple lisp quasi quote as specified
> by the standard. but currently it's commented out because it's lagging
> behind the rest of the lib. (and i think it really never worked...)

Perhaps...

> it will be revived eventually, but it's not priority for us, while we
> have numerous other priorities, so... patches are welcome meanwhile!
> :)

I don't know if I can provide patches; I've already been sidetracked
once this project :)

Thanks.

-- 
Elliott Slaughter

"Any road followed precisely to its end leads precisely nowhere." -
Frank Herbert



More information about the Cl-quasi-quote-devel mailing list