[Ecls-list] Common-Lisp question

Juan Jose Garcia Ripoll lisp at arrakis.es
Wed May 3 05:00:05 UTC 2006


On Wed, 2006-05-03 at 11:14 +0200, Julian Stecklina wrote:
> "Goffioul Michael" <goffioul at imec.be> writes:
> > 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.

Why not? Just redefine the reader for () as well as the reader for $. A
special variable can be used to transmit the information to $, or
otherwise you can make $ expand into something like (#:%symbol-marker
value) and make the reader for lists replace these occurences with the
right value.

Juanjo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20060503/330de356/attachment.sig>


More information about the ecl-devel mailing list