[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
From: James Hester <jamesrhester@gmail.com>
To: Group finalising DDLm and associated dictionaries <ddlm-group@iucr.org>
Sent: Friday, 29 April, 2011 1:38:04
Subject: 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]
Re: [ddlm-group] Removing comma from non-delimited strings
- To: Group finalising DDLm and associated dictionaries <ddlm-group@iucr.org>
- Subject: Re: [ddlm-group] Removing comma from non-delimited strings
- From: SIMON WESTRIP <simonwestrip@btinternet.com>
- Date: Fri, 29 Apr 2011 11:05:25 +0100 (BST)
- In-Reply-To: <BANLkTi=fKfcPjRsk0VJ3QHOntoqzRMSswA@mail.gmail.com>
- References: <BANLkTim-Hve+-7rtd8BXJ7983Z+PnOCS7A@mail.gmail.com><11430.48228.qm@web87014.mail.ird.yahoo.com><BANLkTi=fKfcPjRsk0VJ3QHOntoqzRMSswA@mail.gmail.com>
OK, I now understand the idea, so if there are no strong reasons
for not excluding the comma from the permitted charset for non-delimited strings,
I have no objection. However, symmetry codes are often given as x,y,z etc without delimiters,
so this change might have considerably more impact with regard to CIF1<>CIF2 ?
Cheers
Simon
for not excluding the comma from the permitted charset for non-delimited strings,
I have no objection. However, symmetry codes are often given as x,y,z etc without delimiters,
so this change might have considerably more impact with regard to CIF1<>CIF2 ?
Cheers
Simon
From: James Hester <jamesrhester@gmail.com>
To: Group finalising DDLm and associated dictionaries <ddlm-group@iucr.org>
Sent: Friday, 29 April, 2011 1:38:04
Subject: 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
_______________________________________________ ddlm-group mailing list ddlm-group@iucr.org http://scripts.iucr.org/mailman/listinfo/ddlm-group
Reply to: [list | sender only]
- References:
- [ddlm-group] Removing comma from non-delimited strings (James Hester)
- Re: [ddlm-group] Removing comma from non-delimited strings (SIMON WESTRIP)
- Re: [ddlm-group] Removing comma from non-delimited strings (James Hester)
- Prev by Date: Re: [ddlm-group] Removing comma from non-delimited strings
- Next by Date: [ddlm-group] Alternative proposal for eliding
- Prev by thread: Re: [ddlm-group] Removing comma from non-delimited strings
- Next by thread: [ddlm-group] Revisiting list delimiters
- Index(es):