Re: Empty Alternatives (a.k.a epsilon).

On Fri, Aug 28, 2026, at 09:11, Norm Tovey-Walsh wrote:
> > That's clear if someone reading the ixml grammar can be certain that the empty quotation marks are intentional.
> 
> Why is it any less clear that "" was intended than | or ; or any other sytactic symbol in the grammar. I confess, I’m struggling to see what makes a quoted string special in this regard.

A single symbol cannot be "" (which was, when I pasted it, U+0022 U+200B U+0022) or "" (U+FF02 U+FF02).

Those are not common failure cases for doubled-quotes-are-the-empty-string, but I've encountered both in contexts other than iXML. If "no value" is its own distinct concept in the grammar, giving it a representation different from "string with no characters" seems better than "it's possible for the correct representation of something that isn't 'no value' to be visually indistinguishable from something which is".

Yes, that'd be a rare failure case. But not unknown, and it can take some time before the possibility that the right thing to do is to get a list of code points occurs to the person trying to figure out what is going on, especially if they're relatively new to the tools they're using.

Which is different from "did they mean empty quotes?" and stopping to think and I may well be unreasonably twitchy about being able to see distinctions due to other people's regular expressions and content with a lot of non-breaking spaces. I still prefer "no value" having a different representation than "string with no characters".

> 
> > (Especially since there are work environments where the local customs are strongly against attributes without values, or that it's
> > plausible someone stuck that in so they could do the other other without having to figure out where @name's value should come
> > from, that was going to be the next thing.)
> 
> But surely that’s no more-or-less true of
> 
>    @name: ∅.
> 
> Better to train users to put in
> 
>    @name: FIXME.
> 
> and near the top of the grammar:
> 
>    FIXME: "" .

That absolutely would be better.

Using ∅ seems to me to still be a little bit clearer -- intentional nothing -- rather than the "could be an intentional nothing, could be not adding the value, could be a value I can't see" condition of apparently empty quotes.

> See my earlier remarks about being damned if you allow whitespace and comments in between them, and damned if you don’t.

I am in no way moved to argue with that position!

Anything that's setting out to reify structure out of 80 column data is going to have voyage of the damned aspects. I don't think this can be avoided and I don't want to advocate for trying, either.

-- Graydon

Received on Friday, 28 August 2026 18:05:18 UTC