other symbol for reference types, any references in reference type

This commit is contained in:
ProgramSnail 2023-08-13 12:55:53 +03:00
parent 17a67d2361
commit f94edb035c
2 changed files with 6 additions and 6 deletions

View file

@ -149,13 +149,13 @@ bubble_sort_2 'arr : ref Array['A] = {
};
}
: example of ^ and generics. ^ used to denote that this object allocated on heap
: example of <> and generics. <> (in type definition) used to denote that this object allocated on heap
: object allocated by unique reference by default
^TreeNode 'Key 'Value =
<> TreeNode 'Key 'Value =
& @key Key
& @value Value
& @left ^TreeNode['Key 'Value]
& @right ^TreeNode['Key 'Value];
& @left <> TreeNode['Key 'Value]
& @right <> TreeNode['Key 'Value];
.new = do_something; // static methods