[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Reply to: [list | sender only]
Re: [ddlm-group] The Grazulis eliding proposal: how to incorporateinto CIF?
- To: Group finalising DDLm and associated dictionaries <ddlm-group@iucr.org>
- Subject: Re: [ddlm-group] The Grazulis eliding proposal: how to incorporateinto CIF?
- From: Saulius =?utf-8?q?Gra=C5=BEulis?= <grazulis@ibt.lt>
- Date: Tue, 28 Jun 2011 22:30:14 +0300
- In-Reply-To: <alpine.BSF.2.00.1106281436390.6872@epsilon.pair.com>
- References: <BANLkTi=KKXU7HCc7r2Xji0ssaJg+xkw9Jw@mail.gmail.com><8F77913624F7524AACD2A92EAF3BFA54299C88A2EC@11.stjude.org><alpine.BSF.2.00.1106281436390.6872@epsilon.pair.com>
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 BiotechnologyGraiciuno 8LT-02241 VilniusLietuva (Lithuania) fax: (+370-5)-2602116tel.: office: (+370-5)-2602556 mobile: (+370-684)-49802, (+370-614)-36366_______________________________________________ddlm-group mailing listddlm-group@iucr.orghttp://scripts.iucr.org/mailman/listinfo/ddlm-group
Reply to: [list | sender only]
- Follow-Ups:
- Re: [ddlm-group] The Grazulis eliding proposal: how to incorporateinto CIF? (Herbert J. Bernstein)
- References:
- [ddlm-group] The Grazulis eliding proposal: how to incorporate intoCIF? (James Hester)
- Re: [ddlm-group] The Grazulis eliding proposal: how to incorporateinto CIF?. .. . (Bollinger, John C)
- Re: [ddlm-group] The Grazulis eliding proposal: how to incorporateinto CIF?. .. . (Herbert J. Bernstein)
- Prev by Date: Re: [ddlm-group] The Grazulis eliding proposal: how to incorporateinto CIF?. .. .
- Next by Date: Re: [ddlm-group] The Grazulis eliding proposal: how to incorporateinto CIF?
- Prev by thread: Re: [ddlm-group] The Grazulis eliding proposal: how to incorporateinto CIF?. .. .
- Next by thread: Re: [ddlm-group] The Grazulis eliding proposal: how to incorporateinto CIF?
- Index(es):