[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
--
Reply to: [list | sender only]
Re: [ddlm-group] Handling of missing and null in dREL
- To: "Herbert J. Bernstein" <yayahjb@gmail.com>
- Subject: Re: [ddlm-group] Handling of missing and null in dREL
- From: James Hester <jamesrhester@gmail.com>
- Date: Tue, 14 Jan 2020 23:02:12 +1100
- Cc: Group finalising DDLm and associated dictionaries <ddlm-group@iucr.org>
- In-Reply-To: <CABcsX2568HC-9vYnHitaCNcZn9DmFwGJTsBAEtmzBX_Uo2syTg@mail.gmail.com>
- References: <CAM+dB2dFjxUnYRwVUH1gN6SKoSg8CQMRvfw-kHJmTk2axJ4+aA@mail.gmail.com><CABcsX2568HC-9vYnHitaCNcZn9DmFwGJTsBAEtmzBX_Uo2syTg@mail.gmail.com>
Providing an additional built-in function (e.g. ismissing) is trivial and doesn't on the surface complicate the standard. It is however an interesting question as to what situation it would be used in. One scenario is when writing methods for validation; if certain data names are missing, then a value indicating an error can be returned. Does anybody else have comments to make? If not we can easily just add in ismissing as a built-in function.
On Tue, 14 Jan 2020 at 21:50, Herbert J. Bernstein <yayahjb@gmail.com> wrote:
Dear James,I would hope that '.' and '?' each would be testable for equality so that dREL logic could take appropriate distinct action in each case. Otherwise we need a new built-in function to provide the necessary test.Regards,HerbertOn Tue, Jan 14, 2020 at 1:09 AM James Hester <jamesrhester@gmail.com> wrote:Dear DDLm group,_______________________________________________Happy New Year to all.In preparing the Volume G chapter on dREL I noticed that, while 'missing' and 'null' have been added to dREL as values, there was no discussion about how they would behave when appearing in expressions. I have therefore composed the following two paragraphs, and would appreciate any insight you might have as to problems with the behaviour as stated. While the behaviour for 'missing' is a standard 3-valued logic, the behaviour of null has essentially been dreamt up by me. Note that 'missing' refers to a data value of '?' in a CIF file and null refers to '.'.If there are no objections, these paragraphs will eventually find their way into the standard via Volume G.thanks,James.===========Computations with missing and null values
A value of missing implies that all values in the domain of the data name are possible. Unless otherwise stated, missing values propagate: where missing is an argument to an arithmetic operator or mathematical function, the result will also be missing. Logical operations follow the rules of three-valued logic: A OR missing is true iff A is true, otherwise the result is missing. Likewise, A AND missing is false iff A is false, otherwise the result is missing. An equality test between two values, where at least one is missing, will result in missing. Comparisons between values, where at least one is missing, result in missing. The latter behaviour means that the built-in 'sort' function will return missing if any of the elements of the sorted list have a value of missing. dREL methods may not explicitly test for missing values; the result of comparing missing with missing is missing.
The behaviour of arithmetic operators and built-in mathematical functions is undefined for null arguments. These functions will therefore return missing if any arguments are null. Logical operations and comparisons with null also behave identically to missing, with the important exception that equality with null can be tested. dREL methods can therefore invoke particular behaviour where null is part of the domain of a data value, and this will often serve to specify the interpretation of null in the context of the defined data name.--T +61 (02) 9717 9907
F +61 (02) 9717 3145
M +61 (04) 0249 4148
ddlm-group mailing list
ddlm-group@iucr.org
http://mailman.iucr.org/cgi-bin/mailman/listinfo/ddlm-group
T +61 (02) 9717 9907
F +61 (02) 9717 3145
M +61 (04) 0249 4148
F +61 (02) 9717 3145
M +61 (04) 0249 4148
_______________________________________________ ddlm-group mailing list ddlm-group@iucr.org http://mailman.iucr.org/cgi-bin/mailman/listinfo/ddlm-group
Reply to: [list | sender only]
- References:
- [ddlm-group] Handling of missing and null in dREL (James Hester)
- Re: [ddlm-group] Handling of missing and null in dREL (Herbert J. Bernstein)
- Prev by Date: Re: [ddlm-group] Handling of missing and null in dREL
- Next by Date: Re: [ddlm-group] Handling of missing and null in dREL
- Prev by thread: Re: [ddlm-group] Handling of missing and null in dREL
- Next by thread: Re: [ddlm-group] Handling of missing and null in dREL
- Index(es):