[M3devel] null type?

Hendrik Boom hendrik at topoi.pooq.com
Wed Apr 24 05:09:39 CEST 2013


On Mon, Apr 22, 2013 at 04:29:06PM -0700, Darko Volaric wrote:
> There's another aspect of the NULL type which should be considered here.
> NULL is the complement of REFANY. Just as REFANY is the ultimate ancestor
> of all reference types, NULL is the ultimate descendant of
> all reference types. As a result any variable of a reference type can be
> assigned NIL. Because of its unusual position, NIL is the only member of
> type NULL, since no other value makes sense (which is why it's sometimes
> called the "absurd" type).

I think that terminology comes from the type lattice, and perhaps also 
from the propositions as types formalism.  The type that is properly 
"absurd" is the type with no elements at all, corresponding to the empty 
set.  A functino returning a value of this type can never return, 
because there are no values of that type.

But since Modula 3 (as many other languages) has no truly empty type, 
the bottom of the type lattice is NULL, and I suppose its kind of 
plausible that it get called "absurd" for that reason.

-- hendrik



More information about the M3devel mailing list