Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Null-object/EMal/null-object.emal
Normal file
13
Task/Null-object/EMal/null-object.emal
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
^|
|
||||
| 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue