System.Nil - Manhunter07/MFL GitHub Wiki

Do not confuse with: System.Null which represents an untyped empty value

Declaration

const Nil = \built-in\

Description

The Nil constant in the System package represents an unassigned reference. It is used to initialize (or reset) a reference value to an empty value.

Since there is no other representation for the value of this constant, it is always returned as name. Unlike normal reference values, Nil cannot be de-referenced. Like all references, Nil cannot be addressed, does not support members and is supported only by reference types. Like all references, Nil also does not support any operations performed by operators except for ? and ?:, including +, - or ~. Using it in absolute bars will cause an exception, too.

This constant represents a falsy value for the reference data type. See Boolean evaluation for more details. Since Nil is still a reference (though an unassigned one), TypeOf(Nil) will still return ReferenceType.