Open Defelo opened 1 week ago
Hi @kaikalii, thanks for taking a look at this so quickly! While this specific test case now seems to work, I unfortunately found some more problems:
map [0 0 1] [1 2 3]
°map
Output:
[1 2 3]
[0 1]
So again, we have a map where the number of keys and values differ and thus inserting and removing fail.
Apart from that I also found a second (larger) test case which starts with a valid map and breaks it using remove and insert:
{"hlvq" "xvng" "tv" "sgnr" "rdnp" "bxlh" "ktcxx" "jg" "fm" "lxccq" "fnztg" "zsp" "cc" "vbl" "dk" "tsrjk" "xrzx" "zh" "qvq" "dp" "sh" "jfvnl" "lq" "nnnrz" "zzl" "kmsq"}
map ⟜(⇡⧻)
remove "zh"
insert "kmsq" 0
∩⧻°map
Output:
25
26
In this case the key "kmsq"
is duplicated, so now we have a map with 26 keys but only 25 values.
(tested on commit 3bf1ff3c14610e050c1747db8ba9f623c3dc8c3d)
This should be fixed in 0fce8a1fbf63ff5c593052. Let me know if you find any others!
@kaikalii I think I found another one. This time the program doesn't terminate at all (which unfortunately also causes the vscode extension to not respond anymore):
map {"a" "b" "c"} [1 2 3]
remove "b"
insert "d" 4
insert "e" 42
Fixed in 156d82b963fb8f6d0332e1add. I'm going to leave this issue open for a while just in case.
This does not seem to happen on Uiua Pad, but at least in the native interpreter on x86_64-linux (commit 743ec318ea0dff1e7b79d6bf6953161fbc802d67).
Example:
Output: