# some checks for behavior around ¯0; not strictly necessary to stay, but other tests will probably become meaningless without these! 1âŠ64‿1•bit._cast â‰Ë˜ •ParseFloat¨ "1.2"‿"-0" %% 63‿1/0‿1 ! (4⥊0) (≡ ∧ ≢○(64‿1•bit._cast⊢)) 1↓¯1×π∾4⥊0 ! ≢Ë64‿1•bit._cast â‰Ë˜0‿5âŠâ¥Š(¯1⊸×â‰âŠ¢) (↕3)∾∞∾0÷0 # ¯0 ! ≡´ {•Hash •ParseFloat¨ ð•©â€¿"1.2"}¨ "0"‿"-0" ! 1‿0 ≡ ∊{•ParseFloat¨ ð•©â€¿"1.2"}¨ "0"‿"-0" aâ†(•ParseFloat¨ "1.2"‿"-0"‿"0")∾-⊸⋈0÷0 â‹„ ∊1•Hash¨ a %% 1‿1‿0‿1‿0 aâ†(•ParseFloat¨ "1.2"‿"-0"‿"0")∾-⊸⋈0÷0 â‹„ bâ†0+--a â‹„ ! a •internal.EEqual b â‹„ ! a ≡○(3⊸↑) b â‹„ ! 0≡a •Cmp b â‹„ ! a ≡○(1⊸•Hash¨) b â‹„ ! a ≡○(1⊸•Hash) b aâ†(•ParseFloat¨ "1.2"‿"-0"‿"0")∾-⊸⋈0÷0 â‹„ ! (0‿3‿3‿3âŠa) ≡○•Hash (0‿4‿4‿4âŠa) # functions â·âŸ¨âŠ¢âŠ¢âŠ¢, ⊢⊢⊢, +⊢⊢, ⊢+⊢, ⊢⊢+, ⊢⊢, ⊢⊢, ⊢+, 1⊸+, 1⊸+, 2⊸+, 1⟜+, 1⊸×, ⊢+⊢, ⊢⊢⊢, +⊢⊢, +˘, ע, +˘, +Ë⟩ %% ⟨⊢⊢⊢, +⊢⊢, ⊢+⊢, ⊢⊢+, ⊢⊢, ⊢+, 1⊸+, 2⊸+, 1⟜+, 1⊸×, +˘, ע, +Ë⟩ # various [1‿1, 0‿1, 1‿0, 0‿0, 1‿1, 0‿0] ∊ [0‿0, 0‿1, 1‿0] %% 0‿1‿1‿1‿0‿1 [[0‿0, 0‿1, 1‿0, 1‿1], [1‿1, 0‿1, 1‿0, 0‿0]] ∊ [0‿0, 0‿1, 1‿0] %% 2‿4⥊1‿1‿1‿0‿0‿1‿1‿1 [1‿1, 0‿1, 1‿0, 0‿0, 1‿1, 0‿0] ∊○(â‰âŽ‰0) [0‿0, 0‿1, 1‿0] %% 0‿1‿1‿1‿0‿1 [[0‿0, 0‿1, 1‿0, 1‿1], [1‿1, 0‿1, 1‿0, 0‿0]] ∊○(â‰âŽ‰0) [0‿0, 0‿1, 1‿0] %% 2‿4⥊1‿1‿1‿0‿0‿1‿1‿1 âŠËœâˆ¾Ëœ"ihxtIddKLp"‿'r'‿÷‿"EXiRowcDXx"‿'a'‿"ZNtqFbDCYZ"‿â’‿0.05369125494326554‿↑‿5 %% ∾˜↕10 0‿1∊˜⟨"ab","cd"⟩ %% 0‿0 0‿1⊠⟨"ab","cd"⟩ %% 2‿2 (<"ab")∊"ab"‿"cd" %% <1 (<"cd")∊"ab"‿"cd" %% <1 (<"ef")∊"ab"‿"cd" %% <0 (127⥊"abc")âŠ"abcd" %% 0‿1‿2‿127 (128⥊"abc")âŠ"abcd" %% 0‿1‿2‿128 (32767⥊"abc")âŠ"abcd" %% 0‿1‿2‿32767 (32768⥊"abc")âŠ"abcd" %% 0‿1‿2‿32768 (127⥊"abc")âŠ100⥊"ababacadabacaba" %% (100⥊0‿1‿0‿1‿0‿2‿0‿ 127‿0‿1‿0‿2‿0‿1‿0) (128⥊"abc")âŠ100⥊"ababacadabacaba" %% (100⥊0‿1‿0‿1‿0‿2‿0‿ 128‿0‿1‿0‿2‿0‿1‿0) (32767⥊"abc")âŠ100⥊"ababacadabacaba" %% (100⥊0‿1‿0‿1‿0‿2‿0‿32767‿0‿1‿0‿2‿0‿1‿0) (32768⥊"abc")âŠ100⥊"ababacadabacaba" %% (100⥊0‿1‿0‿1‿0‿2‿0‿32768‿0‿1‿0‿2‿0‿1‿0) ⷠ•internal.Variation⟜(↕1)¨ "Ab"‿"Ai8" %% ⟨⋈0⟩ !∘≡¨⟜⊠0•Hash¨ ⟨↕5 â‹„ 1↓0.5∾↕5 â‹„ 1↓'h'∾↕5⟩ {bâ†â€¢internal.Unshare aâ†"Ai8"•internal.Variation ∾⟨16⥊0‿0‿0‿0‿0‿0‿0‿¯128, 8⥊0, 8↑2⟩ â‹„ câ†8‿64•bit._cast a â‹„ ! 1‿0‿0‿1≡∊c â‹„ •internal.Keep •Hash c â‹„ ! a≡b} # make sure sign bit doesn't mutate away # error messages !"∊: ð•© cannot have rank 0" % 1‿2‿3∊0 !"âŠ: 𕨠cannot have rank 0" % 0âŠ1‿2‿3 !"⊒: 𕨠cannot have rank 0" % 0⊒1‿2‿3 !"∊: Rank of 𕨠must be at least the cell rank of ð•© (⟨2⟩ ≡ ≢ð•¨, 2‿2‿2 ≡ ≢ð•©)" % 1‿2∊2‿2‿2⥊1‿2 !"âŠ: Rank of ð•© must be at least the cell rank of 𕨠(2‿2‿2 ≡ ≢ð•¨, ⟨2⟩ ≡ ≢ð•©)" % (2‿2‿2⥊1‿2)âŠ1‿2 !"⊒: Rank of ð•© must be at least the cell rank of 𕨠(2‿2‿2 ≡ ≢ð•¨, ⟨2⟩ ≡ ≢ð•©)" % (2‿2‿2⥊1‿2)⊒1‿2 # hashmap ("abc"‿"de"‿"fgh" •HashMap ⥊¨↕3).Get "fgh" %% ⟨2⟩ ∞ ("abc"‿"de"‿"fgh" •HashMap ⥊¨↕3).Get "fghi" %% ∞ ("abc"‿"de"‿"fgh" •HashMap ⥊¨↕3).Count"xy" %% 3 ("b" ("a"‿"b" •HashMap "A"‿"C").Set "B").Get "b" %% "B" ((•HashMap˜↕4).Set´ 1‿"one").Keys↕2 %% ↕4 (((•HashMap˜↕4).Delete 1).Set´ 1‿"one").Keys@ %% 0‿2‿3‿1 (((•HashMap˜↕4).Delete 1).Set´ 1‿"one").Values@ %% 0‿2‿3‿"one" ({ð•©.Set´"xy"}âŸ4•HashMap˜↕0).Count@ %% 1 !"•HashMap: Arguments must be lists (⟨⟩≡≢ð•¨, ⟨3⟩≡≢ð•©)" % 'a' •HashMap "str" !"•HashMap: 𕨠and ð•© must have the same length (4≡≠ð•¨, 3≡≠ð•©)" % "stri" •HashMap "str" !"•HashMap: 𕨠contained duplicate keys" % "strs" •HashMap "stri" !"(hashmap).Get: key not found" % ("abc"‿"de"‿"fgh" •HashMap ⥊¨↕3).Get "fg" !"(hashmap).Delete: key not found" % ("abc"‿"de"‿"fgh" •HashMap ⥊¨↕3).Delete 'a' m ↠1‿2 •HashMap vâ†â€¢internal.Unshare 'a'‿4 â‹„ 1 m.Set 9 â‹„ ⟨v, m.Keys@, m.Values@⟩ %% ⟨'a'‿4, 1‿2, 9‿4⟩ m ↠1‿2 •HashMap •internal.Unshare 'a'‿4 â‹„ vâ†m.Values@ â‹„ 1 m.Set 9 â‹„ ⟨v, m.Keys@, m.Values@⟩ %% ⟨'a'‿4, 1‿2, 9‿4⟩