More collection; added list functions

This commit is contained in:
Dmitry Boulytchev 2020-01-15 06:12:01 +03:00
parent 5dcc3a97b0
commit c132073529
5 changed files with 143 additions and 4 deletions

View file

@ -29,5 +29,22 @@ printf ("Set elements: %s\n", elements (s).string);
for i := 0, i < 100, i := i+1
do
printf ("Testing %-3d => %d\n", i, memSet (s, i))
od
od;
printf ("List set: %s\n", listSet ({1, 2, 3, 4, 5}).string);
{
local u = union (listSet ({1, 2, 3, 4, 5}), listSet ({11, 22, 33, 44, 55})), u1;
validateColl (u);
printf ("Set union: %s\n", u.string);
printf ("Elements: %s\n", elements (u).string);
u1 := diff (u, listSet ({1, 22, 3, 44, 5}));
validateColl (u1);
printf ("Set difference: %s\n", u1.string);
printf ("Elements: %s\n", elements (u1).string)
}