Data update
This commit is contained in:
parent
29a5eea0d4
commit
5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions
|
|
@ -1,3 +1,3 @@
|
|||
class C { };
|
||||
var c:C; // is nil
|
||||
var c : owned C?; // is nil
|
||||
writeln(if c == nil then "nil" else "something");
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
val .x, .y = true, null
|
||||
var x, y = true, null
|
||||
|
||||
writeln .x == null
|
||||
writeln .y == null
|
||||
writeln .x ==? null
|
||||
writeln .y ==? null
|
||||
writeln x == null
|
||||
writeln y == null
|
||||
writeln x ==? null
|
||||
writeln y ==? null
|
||||
|
||||
# null not a "truthy" result
|
||||
writeln if(null: 0; 1)
|
||||
|
|
|
|||
6
Task/Null-object/PascalABC.NET/null-object.pas
Normal file
6
Task/Null-object/PascalABC.NET/null-object.pas
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
begin
|
||||
var a := new integer[](1,2,3);
|
||||
if Random(2) = 0 then
|
||||
a := nil;
|
||||
Print(a);
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue