Subject: [clisp-list] macros for CLISP

From: "Hoehle, Joerg-Cyril" <[email-masked]>
Date: Wed Mar 10 03:23:05 2004

Pascal Bourguignon answered to Michael Graffam who wrote:
>> In another application, I want {:a-line :line #(1 2 3) other stuff}
>> to expand to ((:label . :a-line) (:type . :line) (:anchor . 
>#(1 2 3)) other stuff)
>> 
>> By inserting the quote as I described, I can successfully build my
>> a-lists using this form, which nicely saves a bit of 
>repetative typing --
>> but sure enough, when used from read-to-string I get a 
>leading ' which
>> isn't what I want.

>You should insert the quote in your input, not in the reader macro.
>[112]> '$
>(1 2 3)

I believe Michael should query himself whether he may want his reader-macro to only work with literals or also with computed values. E.g. what should be supported among the following:

{:a-line :line #(123) other-stuff-only-literals}

{:a-line :line '#(123) other-stuff}

{:a-line :line (compute-my-array 'A) other-stuff}

(list #\a `(boy {:a-line :line ,(identity '#(1 2 3)) other-stuff} 456))

The macro expander will be different, due to the use of lists as the underlying representation.
If an array, a structure or an instance were used, some difference w.r.t. quoting might not appear, since ANSI requires self-evaluation for these.

Regards,
	Jörg Höhle.