logo       

New, from-scratch implementation of backquote.: msg#00066

lisp.clisp.general

Subject: New, from-scratch implementation of backquote.

Hi,

I found the following thread from 1999 quite intriguing:

Christopher R. Barry in cll on: quasiquote reference implementation
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=87vh8hk0dj.fsf%402xtreme.net&rnum=8
(defmacro defclass* (name supers slots &rest options)
`(macrolet ((do-it ()
`(defclass ,,name ,,supers ,,slots ,,@options)))
(do-it)))
Now you can do something like:
USER(15): (loop for i from 1 to 3
collect (defclass* (intern (format nil "FOO-~D" i)) () ()))
(#<STANDARD-CLASS FOO-1> #<STANDARD-CLASS FOO-2> #<STANDARD-CLASS FOO-3>)

In CLISP-2.30, this gives
*** - EVAL: variable I has no value

For reasons I don't yet understand (I'm not even sure one can expect the do-it
trick to work in all kinds of macroexpansion).
A simple case works:
> (defclass* (intern "FOO-1") () ())
#<STANDARD-CLASS FOO-1>

BTW, the above thread is the one (from 1999) were I suggested a programmable
interface to backquote: what you implemented now for CLISP!

Regards,
Jorg Hohle.


-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
for complex code. Debugging C/C++ programs can leave you feeling lost and
disoriented. TotalView can help you find your way. Available on major UNIX
and Linux platforms. Try it free. www.etnus.com


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise