# Examples 8.1.2.1:
ELT_NIL

The features of the required library class ELT_NIL are used in individual examples below. None of the examples given is a complete class nor necessarily a 'complete' method.

In all of the examples it will be assumed that the code shown is in a class called, say, EXAMPLE.

#### elt_nil

This feature returns a value for the given object which may be treated as a 'no value' item. This is to be distinguished from void. Thus a simple assignment such as -

start_value : SAME := elt_nil

produces start_value for possible use in some initialisation or testing context.

#### is_elt_nil

This feature provides a test which, in a possibly not initialised context, could be used as follows -

if is_elt_nil(start_value) then
...
else
...
end

in which, given the previous example the first branch would be taken.

| Specification Index |  | Language Index |  | Section 8 Index

Comments or enquiries should be made to Keith Hopper . Page last modified: Thursday, 25 May 2000. |