Missing values


When a numerical or point value is unavailable, a special class of object called a "missing value" is returned. The internal structure of missing objects is unspecified and may vary with the implementation. However, the user is guaranteed that the predicate missing? returns true on these objects, and no other type predicate returns true on them. In other words, missing values are similar to scheme end-of-file objects.

Missing values can occur in the middle of sheets, for a variety of reasons. Sheets are initially filled with missing values if no other initial value is specified. Missing values generated by arithmetic functions (e.g. by calling atan with both inputs zero) may be stored into sheets using sample-set!. Finally, values can be removed from locations in sheets using sample-erase!.

The coordinates of a higher-dimensional point (e.g. a 2D point) cannot be missing individually. Either the point is all present or it is all missing. This is a consequence of homogeneity: the choice of axis directions is supposed to be arbitrary and unimportant.

It is not appropriate to indicate a missing value with #f. #f is a boolean whereas missing values stand in lieu of points. If Envision's capabilities are integrated into scheme, we would like to note that the semantics of assoc, assq, and assv would be cleaner if they returned the second element of the pair (if the list contains an entry for the first element) and a missing value (not #f) otherwise.

The user can create a missing value using the function

Most arithmetic and arithmetic tests functions return a missing value if any of their inputs are missing. A function may also return a missing value if it cannot produce a sensible answer (e.g. log applied to zero). Conditional expressions and forms containing embedded conditionals (if, cond, do, scan) generate a run-time error if a missing value is passed to any of their tests. In image processing algorithms, it is frequently much better (particularly for debugging) to return an image with holes rather than generating an error break.

A few functions which can return a value when some of their inputs are missing:


Ownership, Maintenance and Disclaimers

Manual Top Page

Last modified