[Bese-devel] Re: Reader macro
Marco Baringer
mb at bese.it
Sat Mar 25 10:22:28 UTC 2006
"Levente Mészáros" <levente.meszaros at gmail.com> writes:
> I think >>>> is not that bad, actually we can live with )))) pretty well. Also
> emacs can be easily configured to know about <>.
>
> I added enable-xml-reader-syntax and friends. Also modified the reader macro to
> use simply < without breaking the < function I hope (it did work). It just
> looks ahead one character more and if it is a space, then it returns the <
> symbol otherwise reads an XML element. I know it kills symbols starting with <
> character, but I don't know how usual it is? Anyway one would not enable this
> syntax but only in certain places, so I guess it's not a big issue. Remember I
> was starting this whole stuff to help prototyping, because predefining the XML
> elements may give you nice things such as showing the possible attributes,
> child elements, etc.
>
> Do you know any other problem that this solution may introduce?
no, and i think it's a good compromise. personally i'd even leave out
the 'does a space follow the < character' check.
> So an example would looks like this:
>
> (use-package :yaclml)
>
> (use-package :iterate)
>
> (enable-xml-reader-syntax)
>
> (defun alma ()
> <alma :a 1 :b "2"
> (iter (for a from 0 to 3)
> <korte :a a>)>)
>
> (disable-xml-reader-syntax)
i added another read macro to arnesi: #\{. it allows local
modifications to the readtable (and attempts to be smart about not
letting these modification "escape" into the wrong readtable. we can
now do things like this:
(defun alma ()
{with-xml-syntax
<alma :a 1 :b "2"
(iter (for a from 0 to 3)
<korte :a a>)>})
--
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
-Leonard Cohen
More information about the bese-devel
mailing list