"Null" (Compiled Type)
"Null" (Compiled Type)
"Null"
represents a type to indicate the absence of a result.
Details
- "Null" can be used in Typed and related constructs to specify a type.
- Terminating code with a semicolon such as expr; is a typical way to return "Null" from a function.
- Functions that return "Null" do not return anything useful but typically change the state of a program.
Properties
- The only value held by "Null" comes from compilation of the symbol expression Null.
Examples
Basic Examples (2)
"Null" can be used as an output from a CompiledCodeFunction:
Call the function that prints a string and returns a "Null" result:
The Null symbol can be seen with InputForm:
A function that assigns to a raw pointer can return Null to indicate that it is changing the state of an argument:
Generate a raw pointer to an integer:
Call the compiled function with the unmanaged value; it returns Null:
See Also
True False Typed TypeSpecifier FunctionCompile
Compiled Types: Integer64 Real64 ComplexReal64
Related Guides
Related Links
History
Introduced in 2025 (14.3)