[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Reply to: [list | sender only]
Re: [ddlm-group] THREAD TRIPLE QUOTES - Specification
- To: Group finalising DDLm and associated dictionaries <ddlm-group@iucr.org>
- Subject: Re: [ddlm-group] THREAD TRIPLE QUOTES - Specification
- From: Nick Spadaccini <nick@csse.uwa.edu.au>
- Date: Sat, 12 Sep 2009 11:05:06 +0800
- Authentication-Results: postfix;
- In-Reply-To: <20090911095836.Q55632@epsilon.pair.com>
On 11/09/09 10:06 PM, "Herbert J. Bernstein" <yaya@bernstein-plus-sons.com> wrote: > The main value of the treble quoted string is that it allows a much > neater presentation of examples of chunks of CIFS and text in which > presenting such information within semi-colon quoted strings gets > somewhat confusing. > > For this reason, I would suggest that the most important test of > Nick's suggestions would be how faithfully a semi-colon delimited > example could be included with _no_ added or subtracted characters, > so that people reading dictionaries by eye will reproduce those > examples correctly. Yes if treated as a raw string you can faithfully represent a semi-colon delimited text block. BUT you CAN'T faithfully represent a CIF that has itself a triple quote string. Same internal problem that exists trying to do it within semi-colon strings. But CIF within a string is only one thing. What about JMol scripts within a string, probably no problem. What about SBEVSL, possibly no problem. Now what about a Python script - now we can see the problems. However by adding and removing a trailing space after every " encountered we are able to represent everything. > For that reason, I hope we can stay as close to """ and ''' delimiting > truly raw data as possible. I have purposefully only referred to """ because I will argue there is no need to introduce yet another delimiting syntax. The """ will cover everything. I introduced the rap around simply to have one string construct that formally allows for it and requires it to be handled. Do date all such beaviours are conventions, not formally specified as a requirement. > > On Fri, 11 Sep 2009, Nick Spadaccini wrote: > >> Our last discussion on the implementation of triple quoted strings resulted >> in much to-ing and fro-ing and in the end the conclusion was that its >> behaviour was to be identical to the semi-colon delimited strings. I >> preferred a greater degree of parsing of the string but this was not >> popular. >> >> Now our illustrious chair, who sits next to me now, asks the question "what >> is the point of the triple quoted string", to which I can only shrug my >> shoulders. The triple quote string will be useful for containing strings >> that include ", ' and ; (in the first character in a record). They will of >> course fail when you attempt to include the sequence """. Hence they are no >> different to a ; delimited string that cannot include a ; as the first >> character of a line. >> >> Here is a suggestion. The triple quote string (delimited by """) will treat >> its contents a raw, except that >> >> (a) When writing the string, ALL quotes contained within will have a space >> inserted immediately after the " character. This will allow the triple quote >> to be contained within the string by breaking the sequence with spaces so >> the tokeniser is not fooled in to terminating the string. Clearly the >> reverse operation is required in reading the string. I this way is is >> possible to include all manner of text, markup and programming scripts >> within a triple quoted string. >> >> (b) We will formally accept in this string the "eliding" of the newline >> character. Hence a reverse solidus (\) immediately prior to the record >> terminating character(s) will imply the \ and the record terminating >> characters are deleted from the stream, and the next line is wrapped around. >> >> To allow for the odd case when one want's to literally include the \ and the >> record terminating character(s) in the string then the required \ will be >> elided. >> >> In parsing the contents of a string the only things required are >> (1) delete one of the spaces after every " >> (2) treat \<newline> as a wrap around >> (3) treat \\<newline> as the raw string \<newline> >> >> All other characters are left as is. >> >> >> 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 >> > _______________________________________________ > 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]
- References:
- Re: [ddlm-group] THREAD TRIPLE QUOTES - Specification (Herbert J. Bernstein)
- Prev by Date: Re: [ddlm-group] Interactions with methods
- Next by Date: Re: [ddlm-group] Interactions with methods
- Prev by thread: Re: [ddlm-group] THREAD TRIPLE QUOTES - Specification
- Next by thread: Re: [ddlm-group] THREAD TRIPLE QUOTES - Specification
- Index(es):