Am 08.05.2014 04:00, schrieb David A. Wheeler: > I exclaimed: >>> Hmm. Technically I don't think "<*" is legal at all in XML. > On Wed, 7 May 2014 20:05:52 -0400, John Cowan <co...@mercury.ccil.org> > replied: >> It's illegal in the surface syntax. To express it in element >> content or an attribute value, you must write "<*". > Yes. Which means you could write it, and then use some preprocessor to > transform it into valid XML (or use a tweaked XML processor that interpreted > it specially).
Yes, precisely. That's the problem. I can't change all the xml parses a user might want to throw at the code. Hence tweaking the XML processor is no option. What I can do right now using the sweet parser as it is, is simply write let <* a 1 *> {a + a} And get a 2 back. That's how it ends up in the file according to XML spec. No way around. Developer will see it. Ugly, hard to type, hence bad. XML parser will resolve < char reference. What I'd like to have in the XML encoded file would be - taking { } - as grouping: let {* a 1 *} {a + a} This overloads the meaning of #\{ in sweet, thus might not be desirable. In return it minimizes the amount of special characters. And it looks almost like let <* a 1 *> {a + a} though no XML quoting will be superimposed. Since any character already handled special by the reader would also fulfill the desire to not allocate more special characters, one could thing for instance about #\# instead of the braces: let #* a 1 *# {a + a} Sorry, but I would take that as something like a block comment, maybe a special block comment? maybe some compiler hint magic, that sort of thing. YMMV. The the { } pair however is in SRFI-110 already used to "modify the indentation rules and position of implicit parenthesis" so to speak. Having {* and *} do the other kind of the same seems not that bad to me. Please excuse my ignorance, ANTLR sweet.g is beyond my capacity for a timely reply. The CL implementation looks at the first glance like an almost mechanical translation wrt. the Scheme code I read before. If not the sweet.g, I don't see how it could come that dispatching on #\{ would be hard to change. Characters are read one-by-one using my-read/peak-char, aren't they? > > --- David A> Wheeler > > ------------------------------------------------------------------------------ > Is your legacy SCM system holding you back? Join Perforce May 7 to find out: > • 3 signs your SCM is hindering your productivity > • Requirements for releasing software faster > • Expert tips and advice for migrating your SCM now > http://p.sf.net/sfu/perforce > _______________________________________________ > Readable-discuss mailing list > Readable-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/readable-discuss ------------------------------------------------------------------------------ Is your legacy SCM system holding you back? Join Perforce May 7 to find out: • 3 signs your SCM is hindering your productivity • Requirements for releasing software faster • Expert tips and advice for migrating your SCM now http://p.sf.net/sfu/perforce _______________________________________________ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss