-
Notifications
You must be signed in to change notification settings - Fork 2
System.Nil
Do not confuse with: System.Null which represents an untyped empty value
const Nil = \built-in\
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.
Texts, images and code samples on this page are available under MPL 2.0 license