Re: Representation of strings and characters in XML version of ixml

> On 24,Dec2021, at 7:26 AM, Steven Pemberton <steven.pemberton@cwi.nl> wrote:
> 
> In the grammar for ixml, strings are distinguished on their external representation. (To help with round-tripping)
> In particular: @dstring and @sstring have the same semantic, but represent "string" or 'string'.
> 
> However there are two exceptions: @from and @to of a range, which hold a single character, and don't reflect their external representation.
> 
> In a range like ["a"-'z'],  you get <range from='a' to='z'>
> and in a range like [#a-#f] you get <range from='#a' to='#f'>
> 
> 1. You can't round-trip the representation and
> 2. You need to look at the content of the @from and @to to know whether it is a straight character or an encoded one.
> 
> Do we care either way?

I don’t think I care *very* much, but for what it’s worth I
like the current setup, slightly inconsistent though it may be.

That is, I like knowing, from whether something is a dstring
or an sstring, … hmm.  I don’t know, from that, what I was
about to say I knew.  The fact that something came in as a 
dstring tells me double quotes were used but not that there
are no double quotes in the string, and similarly for sstring.
So it doesn’t allow a serializer not to worry about escaping
quotes within quotes.

OK.  My rationale for my preference has just evaporated.
But the preference remains:  I really like distinguishing @hex
from the literal strings.  The single- vs double-quote distinction 
seems unimportant to me in @from and @to, and not
particularly important in literals.  So:


> 
> 1. We could merge dstring and sstring, if we don't care about external representation.

I don’t much mind either way, as long as @hex remains
distinct.

> 
> or alternatively
> 
> 2. We could split @from and @to into their 3 cases.
> 
> sfrom, dfrom, hfrom
> 
> <range dfrom='a' sto='z'>
> <range hfrom='a' hto='f’>

I’d rather not.

Michael

Received on Friday, 24 December 2021 18:54:15 UTC