Hi,
I have written a reader macro which emits XML text into a stream. The
macro right now uses the following form:
#<element :attribute1 "value" :attribute2 "value2"
(iter (for a from 0 to 3)
#<element :attribute1 2>))
I know that #< is used reserved a specific purpose by the specs, but it
seems to be natural to emit XML stuff.
My question is how can I do the same thing without the # sign? The
problem comes from not wanting to redefine the < function. It there a
way to find out whether the < symbol is in function position or not?
Maybe I should read a character forward and if it is not whitespace
then treat it as an XML element otherwise as the < symbol.
levy
In article <························@j33g2000cwa.googlegroups.com>,
················@gmail.com wrote:
> Hi,
>
> I have written a reader macro which emits XML text into a stream. The
> macro right now uses the following form:
>
> #<element :attribute1 "value" :attribute2 "value2"
> (iter (for a from 0 to 3)
> #<element :attribute1 2>))
>
> I know that #< is used reserved a specific purpose by the specs, but it
> seems to be natural to emit XML stuff.
How about something like @<...>
> My question is how can I do the same thing without the # sign? The
> problem comes from not wanting to redefine the < function. It there a
> way to find out whether the < symbol is in function position or not?
> Maybe I should read a character forward and if it is not whitespace
> then treat it as an XML element otherwise as the < symbol.
I think that would work. You should also make it a non-terminating
macro, so that you don't break stuff like char-<.
--
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
················@gmail.com writes:
> Maybe I should read a character forward and if it is not whitespace
> then treat it as an XML element otherwise as the < symbol.
Having to write CL:<= would be annoying.