From: ················@gmail.com
Subject: Reader macro
Date: 
Message-ID: <1143022834.087344.166900@j33g2000cwa.googlegroups.com>
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

From: Barry Margolin
Subject: Re: Reader macro
Date: 
Message-ID: <barmar-D6DD59.21111022032006@comcast.dca.giganews.com>
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 ***
From: Kalle Olavi Niemitalo
Subject: Re: Reader macro
Date: 
Message-ID: <87bqvw5qt0.fsf@Astalo.kon.iki.fi>
················@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.