Discussion List Archives

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

Re: [ddlm-group] The Grazulis eliding proposal: how to incorporateinto CIF?

Dear Colleagues,

  If we were just working with CIF1, I am sure we could
settle on some approximation to this proposal to handle
prefixes and line-folding in text fields, and do so
purely as a semantic convention without invalidating
existing software and data files.

   However, this was introduced to deal with the issues
raised in CIF2 by the non-nestable treble-quote syntax
in the context of major revisions to the overall
syring handling in CIF2 as compared to CIF1.  If CIF2
is going to return to the CIF1 conventions on string
handling, then see my remarks above, but if CIF2 is,
as has currently been proposed, going to handle
string very differently from CIF1, then I am very
uncomfortable with this change.  It just makes the
new string handling even more unusual and inconsistent
than it already is.

   I would suggest we decide firmly and finally between
making CIF2 something with drastically new string handlng
or making CIF2 something that evolves incrementally
from CIF1.

   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 Tue, 28 Jun 2011, Saulius Gra?ulis wrote:

> Dear Herbert,
> dear colleagues,
>
> On Tuesday 28 June 2011 21:45:43 Herbert J. Bernstein wrote:
>
>> ...  I for one find the
>> either-or approach to prefixes and line-folding unnecessary
>> and confusing.  When working with old fortran compilers,
>> I _need_ the line folding protocol.  If the prefixes
>> are bing introduced, I need a way to deal with both the
>> prefixes _and_ the line-folding protocol, not have it
>> be either-or.  I understand that mos people don't
>> see a problem, but I work with software both on new computers
>> and very, very old computers (e.g. I just brought an Indigo
>> back to life).
>
> May I try to disspell one of your worries: the prefixing *does not* exclude 
> line folding; it can perfectly work together with the CIF line folding 
> protocol. The only caution is that one needs to fold first, then prefix; and 
> on reading, first unprefix, and then unfold -- otherwise folding might 
> produce unprefixed lines that start with ';' and break the core CIF syntax.
>
> My example would be:
>
> Lets take the following text:
>
> ;; Lisp, as some other languages, like Molscript or assemblers,
> ;; uses semicolon ';' to denote comments.
> (if x (format t "yes") (format t "no"))
>
> Let's assume for the sake of the argument that we need to fold it at the level 
> of "'" in the second line -- we do this first:
>
> ;; Lisp, as some ot\
> her languages, like\
> Molscript or assem\
> blers,
> ;; uses semicolon '\
> ;' to denote commen\
> ts.
> (if x (format t "ye\
> s") (format t "no"))
>
> (Note the new semicolon at the beginning of the line after folding. Best 
> viewed in a fixed-width font).
>
> Now each line fits into a fixed-length buffer. To indicate that the text is 
> folded, we need to put ;\ at the beginning of the text field:
>
> _text_in_lisp
> ;\
>
> But we can not just put the text into the CIF -- the value will break the CIF 
> syntax. Nasty. We can avoid this, in a general way, by adding a prefix in 
> front of each line so that the lines a guaranteed not to start with a 
> semicolon:
>
> LISP> ;; Lisp, as some ot\
> LISP> her languages, like\
> LISP>  Molscript or assem\
> LISP> blers,
> LISP> ;; uses semicolon '\
> LISP> ;' to denote commen\
> LISP> ts.
> LISP> (if x (format t "ye\
> LISP> s") (format t "no"))
>
> This enlarges lines by a fixed amount, but since the length of a prefix is 
> constant, small and known before writing the line, we can take it into 
> account.
>
> Now we just need to tell all programs (and humans, for that matter), what is 
> the prefix, and what is the real text. I think a natural and unambiguous way 
> is to insert a "sample prefix" between the starting semicolon and the 
> backslash of the first line:
>
> _text_in_lisp
> ;LISP> \\
> LISP> ;; Lisp, as some ot\
> LISP> her languages, like\
> LISP>  Molscript or assem\
> LISP> blers,
> LISP> ;; uses semicolon '\
> LISP> ;' to denote commen\
> LISP> ts.
> LISP> (if x (format t "ye\
> LISP> s") (format t "no"))
> ;
>
> Note the two backslashes at the end of the first line -- the first indicates 
> the end of the prefix, and the second indicates that line folding is in 
> effect.
>
> Now we have arbitrary text (also another CIF) unambiguously folded and 
> prefixed. The transformation is unambiguous since prefixes are always at the 
> beginning of the line, and folding reversed solidi -- at the end of the 
> lines.
>
> The back transformation would unprefix and then unfold as usual.
>
> Sincerely,
> Saulius
>
> PS. For better readability, a "blank" prefix, consisting of one or more space 
> or tab characters, might be preferable:
>
> _text_in_lisp
> ; \\
> ;; Lisp, as some ot\
> her languages, like\
>  Molscript or assem\
> blers,
> ;; uses semicolon '\
> ;' to denote commen\
> ts.
> (if x (format t "ye\
> s") (format t "no"))
> ;
>
> S.G.
>
> -- 
> Dr. Saulius Gra?ulis
>
> Institute of Biotechnology
> Graiciuno 8
> LT-02241 Vilnius
> Lietuva (Lithuania)
>
> fax:          (+370-5)-2602116
> tel.: office: (+370-5)-2602556
>      mobile: (+370-684)-49802, (+370-614)-36366
> _______________________________________________
> 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]
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.