# [ddlm-group] Handling of missing and null in dREL

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
```

Reply to: [list | sender only]