14 lines
756 B
Plaintext
14 lines
756 B
Plaintext
^|
|
|
| EMal has the Variable type (and its keyword var) that is the nullable universal supertype.
|
|
| EMal has the Void type (and its keyword void) that holds only one value: null.
|
|
| EMal has not nullable types (logic, int, real, text, blob), but null equality is always allowed.
|
|
|^
|
|
var a # defaults to null
|
|
int b # defaults to 0
|
|
void c # only one allowed value: null
|
|
writeLine("nullable var equals to not nullable int: " + (a == b)) # allowed, false
|
|
^| if the data type of a is void we are sure that a is null |^
|
|
writeLine("type of a equals to Void data type: " + (generic!a == void)) # true
|
|
writeLine("integer value " + b + " equals to null: " + (b == null)) # allowed, always false
|
|
writeLine("a void value equals to null: " + (c == null)) # always true
|