Discussion List Archives

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

Re: [ddlm-group] Removing comma from non-delimited strings

Hi Simon,

You are correct that under the no-comma proposal your first example
would become a syntax error, and thus hopefully never appear in a CIF2
file, thus reducing confusion.  This is the reasoning behind my point
(1).  I intend that a comma can never appear in a non-delimited
string, not just in the initial position.

Some program authors like to write liberal parsers, which upon
encountering a syntax error attempt to guess what the author of the
file really meant.  There is absolutely no requirement to write CIF
parsers in this way (and it can be counterproductive) but I have
included (2) in the interests of full disclosure.

As for your nice final example, that is a question that those wanting
to write such robust parsers can argue about (among themselves, not
here).  As far we need to be concerned it would be a syntax error.

On Fri, Apr 29, 2011 at 5:25 AM, SIMON WESTRIP
<simonwestrip@btinternet.com> wrote:
> If comma is not allowed in non-delimited strings, then
> isnt _my_numbers = [1,2,3,4,5,6,7] a syntax error?
>
> Or do you mean that a comma cannot start a non-delimited string
> (in which case 1,2,3,4,5,6,7 is indeed a single value)?
>
> How does a 'robust CIF2 program' interpret
> _names [Mitterrand,Fran\,cois] ?
>
> Cheers
>
> Simon
>
>
>
> ________________________________
> From: James Hester <jamesrhester@gmail.com>
> To: ddlm-group <ddlm-group@iucr.org>
> Sent: Thursday, 28 April, 2011 7:49:06
> Subject: [ddlm-group] Removing comma from non-delimited strings
>
> Dear DDLm group,
>
> As foreshadowed in the comma-as-list-delimiter discussion, I would
> like to suggest adding comma to the list of disallowed characters in
> non-delimited text strings, for the following reasons:
>
> (1) This will improve human readability inside lists if the data value
> contains commas, for example:
>
> _my_numbers = [1,2,3,4,5,6,7]
>
> is a single-element list although it will appear to be a 7 element
> list to all but a CIF2 expert.
>
> (2) Robust CIF2 programs can interpret commas as list delimiters
> without danger of misinterpretation.
> --
> T +61 (02) 9717 9907
> F +61 (02) 9717 3145
> M +61 (04) 0249 4148
> _______________________________________________
> ddlm-group mailing list
> ddlm-group@iucr.org
> http://scripts.iucr.org/mailman/listinfo/ddlm-group
>
> _______________________________________________
> ddlm-group mailing list
> ddlm-group@iucr.org
> http://scripts.iucr.org/mailman/listinfo/ddlm-group
>
>



-- 
T +61 (02) 9717 9907
F +61 (02) 9717 3145
M +61 (04) 0249 4148
_______________________________________________
ddlm-group mailing list
ddlm-group@iucr.org
http://scripts.iucr.org/mailman/listinfo/ddlm-group

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

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

ICSU 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.