Subject: Re: Alternative *ML syntaxes [was: Re: StudlyCaps ]
From: (Rob Warnock)
Date: Mon, 18 Nov 2002 03:03:20 -0600
Newsgroups: comp.lang.lisp
Message-ID: <>
Erik Naggum  <> wrote:
| * Rob Warnock
| | Anyway, I'm curious as to what you used with the \foo{...} and {foo ...}
| | syntaxes to represent attributes...
| I have explained this here previously, but it bears repeating. There
| are no attributes. ... So where you have an attribute, I have an extra
| element.  <foo bar="zot"> ...</foo> becomes {foo {bar zot} ...}

Got it, thanks. That of course requires that the processor for "foo"
reach into its body to extract those sub-elements when outputting (say)
HTML, which is no biggy when the processor in is Lisp.

But if one is dealing with an already-existing tag & attribute name
space (such as W3C HTML), it also introduces the ugly possibility of
name collision between tag names and attribute names, with the resulting
possibly ambiguities in some constructs ("bar" as a tag vs. "bar" as
an "attribute"). Perhaps in the case of HTML there are no conflicts of
this type (I haven't checked thoroughly), but if one tried to generate
output into somebody's arbitrary XML form, say, where they hadn't defined
the DTD with that conflict in mind...

Oh, well, one could always hack one's input format to use XML namespaces
to separate "attribute" tag names from "tag" tag names, I suppose.

(Or does HTML and/or XML already require that the tag & attribute names
be disjoint?)

| ...which saves not only on the amount of syntax involved, but on the
| mechanisms used to protect characters from misinterpretation, primarily
| because the number of characters that need to be protected is also
| dramatically reduced in number and a single \ can be used both to
| escape {}\ and to introduce named entities instead of clobbering the
| normally useful characters <>&, and also does not require names for
| the characters used in the markup.

That's why I somewhat prefer \foo{...} to {foo ...}, since I tend to
use curlies in writing plain text (e.g., sample C code), and almost
never use "\". (MS users MMV.)

| In fact, if you cannot find the character in Unicode, you should
| reconsider using it.  Consequently, \entity should be used for
| external references.  SGML's parameter entities were a major design
| mistake and are better solved with real macros.

TeX has shown that \entity and \func{...} can coexist, has it not?


Rob Warnock, PP-ASEL-IA		<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607