On 10/22/07, RLS <evendell(a)gmail.com> wrote:
For self-consistency, how about:
A [Foo] Bar = A Foo Bar, A Bar
A [Foo|Moo] Bar = A Foo Bar, A Moo Bar, A Bar
A [Foo|Moo|] Bar = A Foo Bar, A Moo Bar
I find that very counterintuitive. [Foo|Moo|] to mea reads "Foo, or
Moo, or". In other words, Foo, or Moo, or blank - making the whole
bracketed text optional.
That is, the final pipe/bracket combo would be used to make the
bracketed choices a required part of the expansion.
That's consistent
with the use of [Foo] to mean Foo is optional (you could then do
[Foo|] to mean Foo is required, although that's just a waste of
space). It'd also probably be (logically) easier to parse.
Hm. I don't quite agree, but that's not too important. I'm sure if
this gets implemented we will come up with an expression syntax that
appeals to everyone.
A [[Foo|Moo]] Bar = same as previous, but
discouraged.
Also, there's no reason to implement an optional (but already
deprecated) syntax if we're creating something from scratch.
It's not a special syntax, it just arises automatically if you can nest
expressions. By definition if [X] means X is optional, and [Y|Z] means you
must have Y or Z, then [[Foo|Moo]] must mean that you can optionally have
either a Foo or a Moo.
Steve