Discussion List Archives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ddlm-group] Use of elides in strings

So at the risk of repeating myself, at this stage there seems to be majority acceptance of
what I've been refering to as context-sensitive treatment of elides:

Using the trivial example of _label "A\"BC"

James and Nick would return A"BC

Herb and John would return A\"BC

I would return A"BC

I wont address Herb's examples as I performed a similar exercise back in THREAD3
which was then received with a different opinion :-)



From: Nick Spadaccini <nick@csse.uwa.edu.au>
To: Group finalising DDLm and associated dictionaries <ddlm-group@iucr.org>
Sent: Monday, 23 November, 2009 8:13:20
Subject: Re: [ddlm-group] Use of elides in strings

I now see why we have confused things for Herb. Implicit in our proposal is
that a terminator character is elided ONLY when there is ambiguity because
the same character is used as the string delimiters.

We could make it that both the " and ' characters HAVE to be elided when
ever they appear in ", ' or """ delimited strings, but I favour the case
that they are elided only when they have to. James examples are predicated
on that interpretation.

I add my comments below his with the assumption we are adopting the eliding
of " only when in " or """ strings, and the eliding of ' only when in ' or
''' strings.

On 23/11/09 1:20 PM, "James Hester" <jamesrhester@gmail.com> wrote:

> For what it is worth, I have inserted my understanding of what NIck
> and I propose as a minimal eliding system, by referring to Nick's
> previous emails in this thread.
> The asterisks indicate transformations that we haven't discussed here,
> as in these cases we have terminator sequences rather than single
> characters.  Other approaches are possible in these cases, as the
> terminator sequence can be broken up.  In these cases custom
> dictionary-driven eliding is probably much more reasonable, ie. the
> syntax specification would not provide an eliding mechanism and the
> cut-and-paste brigade might get a bit more mileage.
> On Mon, Nov 23, 2009 at 3:13 PM, Herbert J. Bernstein
> <yaya@bernstein-plus-sons.com> wrote:
>> I am now totally lost.  Please start over with a coherent proposal
>> for the syntax of a quoted string.  In particular, please state
>> how the following strings will be parsed
>> "ab\"cd"                -> ab"cd
>> 'ab\"cd'                      ab\"cd
>> "ab\\"cd"                    ab\"cd
>> 'ab\\"cd'                    ab\\"cd

Agreed to all of the above.

>> ;ab\"cd\                    (*)
>> ;

I see no ambiguity here so I would say
(the \n being the single byte newline and assuming there aren't trailing
spaces on the first line)

>> ;ab\\"cd\\                  (*)
>> ;

I see no ambiguity here so I would say
(the \n being the single byte newline and assuming there aren't trailing
spaces on the first line)

NOT WITHSTANDING IN BOTH CASES that the elide before the newline may
actually mean a wrap around - but that is defined at a dictionary level.

>> """ab\""""                  (*)

I have argued previously this is

>> """ab\\""""                  (*)

This would be


>> {"abcd\"":ggg}          {abcd":ggg}
>> {'abcd\"':ggg}          {abcd\":ggg}


>> "resum\'ee"              resum\'e
>> 'resum\'ee'              resum'e


I believe given our proposal, this is a consistent interpretation. It is
easy to implement and will cover all classes of " and ' embedding.



Associate Professor N. Spadaccini, PhD
School of Computer Science & Software Engineering

The University of Western Australia    t: +61 (0)8 6488 3452
35 Stirling Highway                    f: +61 (0)8 6488 1089
CRAWLEY, Perth,  WA  6009 AUSTRALIA  w3: www.csse.uwa.edu.au/~nick
MBDP  M002

CRICOS Provider Code: 00126G

e: Nick.Spadaccini@uwa.edu.au

ddlm-group mailing list
ddlm-group mailing list

Reply to: [list | sender only]
International Union of Crystallography

Scientific Union Member of the International Science Council (admitted 1947). Member of CODATA, the ISC Committee on Data. Partner with UNESCO, the United Nations Educational, Scientific and Cultural Organization in the International Year of Crystallography 2014.

International Science Council Scientific Freedom Policy

The IUCr observes the basic policy of non-discrimination and affirms the right and freedom of scientists to associate in international scientific activity without regard to such factors as ethnic origin, religion, citizenship, language, political stance, gender, sex or age, in accordance with the Statutes of the International Council for Science.