[Ecls-list] Common-Lisp question

Goffioul Michael goffioul at imec.be
Wed May 3 02:41:25 UTC 2006


> > I have a common-lisp question, maybe someone here has an answer.
> > I'm trying to implement a macro character ($), but I'd like 
> different 
> > expansion when the associated form is at the beginning of a 
> cons or not.
> > So, ($f1 a b) would get me one expansion, and (func $f1 a) 
> would get 
> > me a different expansion. Is it possible to detect such 
> cases in the 
> > macro reader function?
> 
> With ANSI CL this is not possible. Of course you could 
> enclose occurences of $ within [ ] or something, much like ` 
> and , work.

I was afraid of this :-)

> What is your reader macro expanding to?

Quite complex to explain, but basically it expands to a data access
function call, whose content is a lambda expression. In the
(func $f1 a) case, I want the lambda expression to be executed, and
in the ($f1 a b), I want it to be simply returned (it will be exeucted
later on, after some required internal variables setup). I want to use
the same simple syntax and match as close as possible the LISP way of
doing.

Michael.




More information about the ecl-devel mailing list