Fixed bug in patters, pattern matching and tests

This commit is contained in:
Dmitry Boulytchev 2020-02-24 01:08:09 +03:00
parent 3e2c87d42f
commit 897af34aa9
7 changed files with 21 additions and 15 deletions

View file

@ -79,13 +79,13 @@ public fun flatten (l) {
fun append (x) {
local new = x : {};
curr [0][1] := new;
curr [0] := new
}
iter (fun (x) {iter (append, x)}, l);
res [1]
}

View file

@ -3,11 +3,11 @@ import Collection;
local a = {1, 2, 3}, b = {1, 2, 3}, t = emptyHashTab ();
t := addHashTab (t, a, 100);
validateColl ();
validateColl (t);
printf ("HashTab internal structure: %s\n", t.string);
t := addHashTab (t, b, 200);
validateColl ();
validateColl (t);
printf ("HashTab internal structure: %s\n", t.string);
printf ("Searching: %s\n", findHashTab (t, a).string);