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

Re: [ddlm-group] THREAD 3: The alphabet of non-delimited strings.

This is an important email to clarify some misconceptions or misreadings of
what I have said.

On 12/10/09 7:01 PM, "Herbert J. Bernstein" <yaya@bernstein-plus-sons.com>
wrote:

> Dear Colleagues,
> 
>    If I understand the James and Brian's modified form of 1.2 correctly,
> when writing a string in the future we would do the following:
> 
>    1.  If it contains any of the characters that might cause confusion
> inside a bracketed constuct, or which contained any of the quoting
> chacacters, the writing software would be required to quote it, but,
> 
>    2.  When writing any quoted construct, we would always follow the
> tailing quote with whitespace.
> 
> Thus in writing a bracketed series of quoted strings, we would follow
> each trailing quote with a space before the comma or close bracket, but
> on read would accept a comma coming immediately after the close quote.

Yes. So you would write {"Hello" , "Goodbye" } but the specification says
all you need is {"Hello","Goodbye"}. The former is what is caused by the
demand for trailing whitespace that has been pushed by certain people. As
you can see it is as totally unnecessary in the recursive compound structure
as it is at the zeroth level.

> Is that correct?
> 
> I also believe that Nick has asked that the "(,...)" constructs not be
> considered bracketed constructs.
> 
> Is that correct?


NO I HAVEN'T. It is important we clarify this point right here. I have said
the only thing not allowed within quote strings is a quote and a newline. So
the above is considered a double quote delimited string. Remember we are at
the LEXER level which only returns back legitimate strings matching the
tokens. The fact that the string may be a list cannot be determined until
the dictionary is accessed to determine the data item's type. Of course you
could infer it by parsing it, but its type is strictly defined in the
dictionary.

Similarly "103.7" and "103.7(3)" are legitimate quoted strings, which may be
a float and a measured respectively but only the dictionary can tell me.
Again I can guess if I am going to be lazy and not use the dictionary.

> If both are correct, does that mean that we will always present things
> such as (3.42(1),1.58(6)), used, say for a complex number, as
> "(3.42(1),1.58(6))"

According to my latest character restrictions (3.42(1),1.58(6)) is allowed,
and would mean the same thing as "(3.42(1),1.58(6))".

Just for the record in the new DDLm there is a complex type which would be
3.42(1)+1.58(6)j and can be "3.42(1) + 1.58(6)j" but which we output in our
dREL machinery as {3.42(1) + 1.58(6)j}.

> To be consistent with Brian's "maximally disruptive" suggestion, might
> it not be more useful for future development to allow parens as bracketed
> constructs?  I do not believe that there is any serious chance of either
> parser of user confusition between the bracketed construct use of () and
> the esd use of parens.

ALL bracketed constructs I have proposed recently are {} based. () are
reserved for su, notwithstanding that (3.42(1),1.58(6)) is a perfectly
legitimate unquoted text string, it just doesn't mean anything other than
that beyond the lexer.

Nick

==========================================
> 
> On Mon, 12 Oct 2009, Brian McMahon wrote:
> 
>> I am leaning increasingly to the viewpoint that - so long as it is
>> technically possible to interconvert old and new CIFs without loss
>> of information (although there may be loss of functionality in the
>> CIF1.2->CIF1.1 direction) - the new specification should be maximally
>> disruptive.
>> 
>> "Maximally" of course doesn't mean "gratuitously". Only changes
>> should be introduced that have clear purpose, and those changes
>> should be clearly and cleanly documented on the CIF web site,
>> with an accompanying description of the intended purpose.
>> 
>> As Herbert says, there are many communities. They should be reassured
>> that there is no need for them to change *anything*, until and unless
>> they need to use the new functionality offered by CIF1.2.
>> 
>> Large-scale service providers (such as Acta and the PDB) will need
>> to be among the first to tool up for CIF1.2 so that they can handle
>> CIFs that are written to the new spec - but they are already the
>> most highly motivated to introduce the new features. They will
>> also need to provide services that deliver CIF data in 1.1 and 1.2
>> formats, to accommodate the large established legacy software base.
>> 
>> We do need to provide interconversion tools, and I think it may
>> make life a little easier if we *mandate* a "#\#CIF_1.2" magic
>> comment version identifier.
>> 
>> Note also that it is very likely that the vast majority of data
>> CIFs created by many (if not most) 1.2-capable applications will
>> in practice be fully conformant to the existing 1.1 specs.
>> 
>> With this philosophy, therefore, my votes are:
>> 
>> "1.2 Terminate all quoted strings on the occurrence of the
>>     trailing quoted delimiter without consideration of the
>>     next character"
>> 
>> BUT with James' proviso: "I would require that there was always
>> whitespace between tokens, regardless of the status of embedded
>> delimiters."
>> 
>> "2.3 Modify the current convention to forbid the use of
>>     any characters other than a strictly limited set
>>     of characters, making it an error to read a non-delimited
>>     string that does not comply even if the intention
>>     can be inferred from context"
>> 
>> "3.2  Use UTF-8"
>> 
>> I haven't been keeping tally of the votes, but if the result is a tie,
>> I suggest the Chairman toss a coin and we move on to adopt a fixed
>> specification, so that we can begin to start coding. Whatever we
>> decide on, it will not be perfect and will carry its own set of
>> nuances and difficulties (which might even feed back and demonstrate
>> that we have - with all good intentions - chosen a solution that is
>> in practice unworkable).
>> 
>> Regards
>> Brian
>> 
>> 
>> 
>> As Herbert says
>> 
>> On Sun, Oct 11, 2009 at 08:16:35AM +0000, SIMON WESTRIP wrote:
>>> So in general, the policy should be that any changes that invalidate
>>> existing CIFs
>>> should only be allowed if absolutely necessary and only using the deprecated
>>> approach -
>>> i.e. options such as 1.2 and 2.3 should not in fact be options at this
>>> stage?
>>> 
>>> Cheers
>>> 
>>> Simon
>>> 
>>> 
>>> 
>>> 
>>> ________________________________
>>> From: Herbert J. Bernstein <yaya@bernstein-plus-sons.com>
>>> To: Group finalising DDLm and associated dictionaries <ddlm-group@iucr.org>
>>> Sent: Saturday, 10 October, 2009 21:58:03
>>> Subject: Re: [ddlm-group] THREAD 3: The alphabet of non-delimited strings.
>>> 
>>> Dear Colleagues,
>>> 
>>>    There are multiple communities out there.
>>> 
>>>    There are, of course, the internal IUCr and PDB uses of CIF.
>>> 
>>>    For small molecule work, there are well-established CIF-based workflows
>>> using DDL1-based CIFS.  There is a very large base of exsting files, and
>>> write logic.   There would be great value in the DDLm-based validation
>>> for this community, but if we make it difficult and confusing, DDLm
>>> will simply be ignored.  If we make writers for CIFs that cannot be read
>>> by the base of exsiting software, those writers will not be used.
>>> 
>>>    For macromolecular structural work, there is very little adoption of
>>> DDL2-based CIF outside of the software base controlled by the PDB, so
>>> there is it feasible to try to make signficant changes, but for the
>>> rapidly growing imgCIF DDL2-based software, changes that have not been
>>> discussed with the detector community and vetted by them will, as with the
>>> small molecule community, simply be ignored.
>>> 
>>>    In addition, there are many idosyncratic uses of CIF, e.g. in the
>>> "harvest" mode for macromolecular experiments that have their own
>>> softare base and user community, and are simply not going to be told
>>> what to do.
>>> 
>>>    There are sundry and assorted CIF software packages standing alone and
>>> embedded in applications, for which the delvelopers and maintainers have
>>> no particular need of desire to change anything, and who are not
>>> conerned about data validation, and who are going to continue to read
>>> what they currently read and, more importantly, write what they currently
>>> write, no matter what COMCIFS says.
>>> 
>>>    There is much more to this, but the bottom line is, if we want to make
>>> changes and improvements, we need to talk to and involved a fairly broad
>>> sampling of a variety of communities, or we will meet very stiff
>>> resistance.
>>> 
>>>    Because of this, I think it would be best to work on clean well-defined
>>> proposals with solid upwards and downwards migration plans, and then to
>>> have workshops to get community feedback.
>>> 
>>>    Regards,
>>>      Herert
>>> 
>>> =====================================================
>>>   Herbert J. Bernstein, Professor of Computer Science
>>>     Dowling College, Kramer Science Center, KSC 121
>>>          Idle Hour Blvd, Oakdale, NY, 11769
>>> 
>>>                   +1-631-244-3035
>>>                   yaya@dowling.edu
>>> =====================================================
>>> 
>>> On Sat, 10 Oct 2009, SIMON WESTRIP wrote:
>>> 
>>>> Dear all
>>> 
>>> Before this thread diverges into a deeper discussion of UTF-8 and unicode,
>>> can I ask for clarification of a few points.
>>> 
>>> As an observer, seems to me that this thread has been 'stumbling' because
>>> of some fundamental issues with respect to
>>> 
>>> adopting DDLm. I now find myself questioning my understanding of the
>>> situation. At the risk of sounding as if I'm just repeating some of the
>>> recent comments from Brian and James (or indeed that I shouldnt have been
>>> asked to listen in at all), I've been observing these discussions under
>>> the assumption that:
>>> 
>>> 1) it was already accepted that CIF1.2 is going to have to be treated as a
>>> distinct format, requiring new CIF1.2-enabled software. The new software
>>> should be backwards-compatible - able to read/write CIF1.1 if required.
>>> This is not an uncommon scenario (e.g. in the world of word-processing
>>> software - the latest format will not be readable by programs written for
>>> the previous formats, but programs supporting the latest format will be
>>> able to convert between the old and new). This is an acceptable annoyance
>>> if the new format markedly enhances the old format?
>>> 
>>> 2) The general aim is to make the transition between the old and new as
>>> painless as possible, but not at the expense of realizing the benefits of
>>> the new?
>>> 
>>> 3) The sooner the specs for the new are made available the better - so
>>> that developers can at least keep them in mind when they work on their
>>> projects - whether it be a fully fledged CIF reader/writer, or a program
>>> that just accepts CIF as a data source.
>>> 
>>> Forgive me if I'm off the mark with my assumptions, or if I'm going over
>>> ground you've already covered (being a newcomer, I'm afraid I may not be
>>> up to speed on all this, though as someone who may well be involved in
>>> implementing whatever is decided upon, even my ignorance may be of use to
>>> you when it comes to considerations of how the changes may be handled by
>>> interested parties).
>>> 
>>> Cheers
>>> 
>>> Simon
>>> 
>>> Simon P. Westrip
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> ________________________________
>>> From: Herbert J. Bernstein <yaya@bernstein-plus-sons.com>
>>> To: Group finalising DDLm and associated dictionaries <ddlm-group@iucr.org>
>>> Sent: Saturday, 10 October, 2009 18:02:35
>>> Subject: Re: [ddlm-group] THREAD 3: The alphabet of non-delimited strings.
>>> 
>>> Yes, most modern Fortrans cannot tell the difference between UTF-8 and
>>> ascii.
>>> 
>>> =====================================================
>>>    Herbert J. Bernstein, Professor of Computer Science
>>>      Dowling College, Kramer Science Center, KSC 121
>>>           Idle Hour Blvd, Oakdale, NY, 11769
>>> 
>>>                    +1-631-244-3035
>>>                   yaya@dowling.edu
>>> =====================================================
>>> 
>>> On Sat, 10 Oct 2009, Brian McMahon wrote:
>>> 
>>>> Dear Herbert
>>>> 
>>>> Thanks for the clarification. I've now read
>>>>  http://en.wikipedia.org/wiki/UTF-8
>>>> :-)
>>>> 
>>>> It seems to me that the STAR spec still needs to be modified to
>>>> state explicitly that its allowed character set is Unicode as
>>>> expressed in UTF-8 encoding.
>>>> 
>>>> I note also from the above Wikipaedia entry that there is some
>>>> latitude in practices for handling invalid byte sequences (and to some
>>>> extent invalid code points). I think we should consider whether the
>>>> full STAR/CIF1.2 specs should formalise exception handling procedures
>>>> in such cases.
>>>> 
>>>> Regards
>>>> Brian
>>>> 
>>>> PS Just for my own information, does the statement
>>>>> For the point of view of any
>>>>> C-program intended to work with the 256-chacacter ISO characters sets,
>>>>> a UTF-8 string handles just the same as an ISO string.
>>>> hold equally well for modern Fortran applications?
>>>> 
>>>> On Sat, Oct 10, 2009 at 12:01:05PM -0400, Herbert J. Bernstein wrote:
>>>>> Dear Colleagues,
>>>>> 
>>>>>    There is a misundertsanding about UTF-8.  For the point of view of any
>>>>> C-program intended to work with the 256-chacacter ISO characters sets,
>>>>> a UTF-8 string handles just the same as an ISO string.  The major
>>>>> differences are that the bottom 128 characters are the US national variant
>>>>> we call ASCII, and the second 128 characters that in the past would have
>>>>> had the accented and special characters needs to handle the western
>>>>> European languages in an ASCII environment have been replaced with the
>>>>> variable length encodings for a 31 bit character set.  That is what is
>>>>> nice about UTF8 -- it is actually using what should be printable
>>>>> characters to do its encoding, avoiding anything that looks like
>>>>> binary data.
>>>>> 
>>>>>    UTF-16/UCS-2 is different.  There you have a lot that looks like binary
>>>>> when working in an ascii world, and you need special libraries (for wide
>>>>> characters) to deal with them, unless you are working in java or with a
>>>>> browser, where that is the native encoding.
>>>>> 
>>>>>    We are in the midst of a painful, worldwide transition in which we have
>>>>> a mixture of:
>>>>> 
>>>>>    1.  The code code-page based character encodings based on the multiple
>>>>> ISO national variants.  ASCII is just the US national variant.
>>>>>    2.  The UTF-16/UCS-2 version of unicode heavily adopted by many
>>>>> hardware
>>>>> vendors and used as the native encoding in many operating systems and all
>>>>> browsers
>>>>>    3.  The UTF-8 version of unicode, extensively adopted in Linux-based
>>>>> applications and slowly being accepted in almost all operating systems.
>>>>> 
>>>>> My guess is that by 10 years from now, UTF-8 will have been fairly
>>>>> completely adopted except for some legacy java and browser UCS-2
>>>>> stuff.
>>>>> 
>>>>>    My suggestion would be to try to support ascii, UCS-2 and UTF-8 for the
>>>>> moment and work towards joining the march towards UTF-8.
>>>>> 
>>>>>    Regards,
>>>>>      Herbert
>>>>> 
>>>>> =====================================================
>>>>>   Herbert J. Bernstein, Professor of Computer Science
>>>>>     Dowling College, Kramer Science Center, KSC 121
>>>>>          Idle Hour Blvd, Oakdale, NY, 11769
>>>>> 
>>>>>                   +1-631-244-3035
>>>>>                  yaya@dowling.edu
>>>>> =====================================================
>>>>> 
>>>>> On Sat, 10 Oct 2009, Brian McMahon wrote:
>>>>> 
>>>>>> Regarding the adoption of the Unicode character set, I agree that
>>>>>> this would make it easier to accommodate accented and non-Latin
>>>>>> characters and symbols, and I see no reason to oppose implementing
>>>>>> it as a UTF-8 encoding, and so I vote 3.2.
>>>>>> 
>>>>>> (It's not a panacea, especially for maths, where new symbols can
>>>>>> always be invented, and one must be able to specify a two-dimensional
>>>>>> layout as well as just the glyphs, so we shall still need other
>>>>>> approaches for various types of "rich" text.)
>>>>>> 
>>>>>> However, this is a binary encoding, is it not, and so the underlying
>>>>>> STAR specification must be modified to accommodate this. (I'm afraid
>>>>>> I haven't got Nick's draft paper for the revised STAR specification
>>>>>> to hand, so I apologise if that's already been addrressed.)
>>>>>> 
>>>>>> Does it raise issues of endian-ness? If we are introducing binary
>>>>>> encodings, are there any reasons to restrict the character set
>>>>>> encoding to UTF-8 or should one also allow UTF-16 etc. (i) in STAR
>>>>>> and (ii) in CIF? And, ultimately, is there a prospect of extending
>>>>>> the STAR spec in a way that properly accommodates at least the CBF
>>>>>> implementation, and possibly other binary data incorporation?
>>>>>> 
>>>>>> I am happy in this case that handling by "old" CIF software can
>>>>>> be done by adopting a protocol that allows UTF-8 Unicode characters
>>>>>> to be represented by ASCII encodings such as \u27. (I don't think
>>>>>> that we need specify a protocol at this point, just be sure that
>>>>>> one can be defined if needed.)
>>>>>> 
>>>>>> I again draw attention to the amusing fact that with an ASCII
>>>>>> Unicode encoding, "O\u27Neill" is a valid data value under the
>>>>>> current proposals, whereas the UTF-8 equivalent would not be,
>>>>>> because the UTF-8 encoding of ' is just ' !
>>>>>> 
>>>>>> Brian
>>>>>> _______________________________________________
>>>>>> 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
>>>> _______________________________________________
>>>> 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
>>> _______________________________________________
>>> 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
>> 
>> _______________________________________________
>> 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

cheers

Nick

--------------------------------
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@iucr.org
http://scripts.iucr.org/mailman/listinfo/ddlm-group

Reply to: [list | sender only]