diff --git a/test/cases/cells.bqn b/test/cases/cells.bqn index 610e5cbf..84914626 100644 --- a/test/cases/cells.bqn +++ b/test/cases/cells.bqn @@ -22,55 +22,55 @@ !"⎉: Result rank too large" % (1⥊˜ 0∾204⥊2)⎉50 1⥊˜ 0∾100⥊2 !"⎉: Result rank too large (204 ≡ =𝕩, 200 ≡ =𝔽v)" % {𝕊:(200⥊1)⥊1}⎉1 (205⥊1)⥊1 -!"⎉: Argument frames don't agree (⟨3⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩, common frame of 1 axes)" % "abc" ⊢⎉0 "ab" -!"˘: Argument frames don't agree (⟨3⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩, common frame of 1 axes)" % "abc" ⊢˘ "ab" +!"𝕨⎉𝕩: Argument frames don't agree (⟨3⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩, common frame of 1 axes)" % "abc" ⊢⎉0 "ab" +!"𝕨˘𝕩: Argument frames don't agree (⟨3⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩, common frame of 1 axes)" % "abc" ⊢˘ "ab" ! ∧´{𝕊: ! (∾≡{𝕨∾𝕩}´) (<•rand.Range∘≠⊸⊑ ⟨"ab",1‿2,⟨⟩,↕0,""⟩) ∾˜ (4•rand.Range≠)⊸⊏ ⟨1, {⇐}, 'a', <'a', <{⇐}, "ab", ↕0, ""⟩}¨↕10000 # error cases that could be affected by special code -!"∧: Argument cannot have rank 0" % ∧˘↕2 -!"∨: Argument cannot have rank 0" % ∨˘"a" +!"∧𝕩: 𝕩 cannot have rank 0" % ∧˘↕2 +!"∨𝕩: 𝕩 cannot have rank 0" % ∨˘"a" !"Expected non-negative integer, got ¯3" % 2‿¯3/⎉1 6‿2⥊0 -!"/: Lengths of components of 𝕨 must match 𝕩 (3 ≠ 4)" % 1‿2‿3⊸/˘≍4‿5‿6‿7 -!"/: Simple 𝕨 must have rank 0 or 1 (2≡=𝕨)" % (2‿3‿1⥊↕4) /˘ ↕2 +!"𝕨/𝕩: Lengths of components of 𝕨 must match 𝕩 (3 ≠ 4)" % 1‿2‿3⊸/˘≍4‿5‿6‿7 +!"𝕨/𝕩: Simple 𝕨 must have rank 0 or 1 (2≡=𝕨)" % (2‿3‿1⥊↕4) /˘ ↕2 !"𝕨/𝕩: Length of compound 𝕨 must be at most rank of 𝕩" % (<↕0)/˘○(5⊸⥊)<"ab" -!"⊏: Indexing out-of-bounds (24∊𝕨, 4≡≠𝕩)" % 1‿24⊏⎉1↕4‿4 -!"⊏: Indexing out-of-bounds (4∊𝕨, 4≡≠𝕩)" % ⊏⎉1˜6‿4⥊↕24 +!"𝕨⊏𝕩: Indexing out-of-bounds (24∊𝕨, 4≡≠𝕩)" % 1‿24⊏⎉1↕4‿4 +!"𝕨⊏𝕩: Indexing out-of-bounds (4∊𝕨, 4≡≠𝕩)" % ⊏⎉1˜6‿4⥊↕24 !"𝕨⊏𝕩: 𝕨 must be an array of numbers or list of such arrays" % 0‿@‿¯1⊏⎉1 5‿2⥊0.5 !"Expected integer, got ¯5.25" % ¯5.25⊏˘∘‿4⥊↕24 -!"⊏: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % 0‿0‿1 ⊏˘○(≍˘) 10000×↕3 -!"⊏: 𝕩 cannot be a unit" % 0⊏˘5⥊<"a" -!"⊏: 𝕩 cannot be a unit" % (3‿0⥊⟨⟩)⊏˘↕3 +!"𝕨⊏𝕩: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % 0‿0‿1 ⊏˘○(≍˘) 10000×↕3 +!"𝕨⊏𝕩: 𝕩 cannot be a unit" % 0⊏˘5⥊<"a" +!"𝕨⊏𝕩: 𝕩 cannot be a unit" % (3‿0⥊⟨⟩)⊏˘↕3 !"Expected integer, got 0.1" % 0.1⊑˘3‿5⥊↕15 -!"⊑: 𝕩 must be a list when 𝕨 is a number (3‿4 ≡ ≢𝕩)" % 5⊑˘↕2‿3‿4 +!"𝕨⊑𝕩: 𝕩 must be a list when 𝕨 is a number (3‿4 ≡ ≢𝕩)" % 5⊑˘↕2‿3‿4 !">: Result rank too large (80 ≡ =𝕩, 205 ≡ =⊑𝕩)" % >⎉80 (200⥊1)⥊<(205⥊1)⥊1 !"⎉: Result rank too large (195 ≡ =𝕩, 210 ≡ =𝔽v)" % >⎉5 (200⥊1)⥊<(205⥊1)⥊1 -!"∾: Lengths not matchable (⟨6⟩ ≡ ≢𝕨, 1‿1 ≡ ≢𝕩)" % ("abc"∾"def")∾˘○(3/≍)≍"a" -!"∾: Argument ranks must differ by 1 or less (0≡=𝕨, 2≡=𝕩)" % 1∾˘↕3‿3‿3 -!"∾: Lengths not matchable (4‿2 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (3‿4‿2⥊4)∾˘3‿3‿3⥊5 -!"≍: 𝕨 and 𝕩 must have equal shapes (3‿4 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (↕3‿4)≍⎉2 2‿3‿3⥊↕18 -!"≍: Result rank too large (255≡=𝕩)" % ≍⎉∞ 0⥊˜255⥊1 +!"𝕨∾𝕩: Lengths not matchable (⟨6⟩ ≡ ≢𝕨, 1‿1 ≡ ≢𝕩)" % ("abc"∾"def")∾˘○(3/≍)≍"a" +!"𝕨∾𝕩: Argument ranks must differ by 1 or less (0≡=𝕨, 2≡=𝕩)" % 1∾˘↕3‿3‿3 +!"𝕨∾𝕩: Lengths not matchable (4‿2 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (3‿4‿2⥊4)∾˘3‿3‿3⥊5 +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (3‿4 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (↕3‿4)≍⎉2 2‿3‿3⥊↕18 +!"≍𝕩: Result rank too large (255≡=𝕩)" % ≍⎉∞ 0⥊˜255⥊1 !"shift: Lengths not matchable (⟨6⟩ ≡ ≢𝕨, 1‿1 ≡ ≢𝕩)" % ("abc"∾"def")«˘○(3/≍)≍"a" !"shift: =𝕨 must be =𝕩 or ¯1+=𝕩 (0≡=𝕨, 2≡=𝕩)" % 1«˘↕2‿2‿2 -!"»: Argument cannot be a scalar" % »⎉0 2‿3‿1⥊↕6 -!"⌽: Argument cannot be a unit" % ⌽˘↕10 +!"»𝕩: 𝕩 cannot be a scalar" % »⎉0 2‿3‿1⥊↕6 +!"⌽𝕩: 𝕩 cannot be a unit" % ⌽˘↕10 !"Expected integer, got 1.5" % 1.5↑˘↕2‿3‿2 -!"↑: 𝕨 must have rank at most 1 (1‿2 ≡ ≢𝕨)" % (≍1‿2)⊸↑˘↕2‿3‿2 -!"↓: 𝕨 must have rank at most 1 (4‿2 ≡ ≢𝕨)" % (4‿2⥊↕8)↓˘○≍@ +!"𝕨↑𝕩: 𝕨 must have rank at most 1 (1‿2 ≡ ≢𝕨)" % (≍1‿2)⊸↑˘↕2‿3‿2 +!"𝕨↓𝕩: 𝕨 must have rank at most 1 (4‿2 ≡ ≢𝕨)" % (4‿2⥊↕8)↓˘○≍@ !"Integer out of range: 1e20" % 1e20⌽˘3‿10⥊10 !"Expected number" % 3‿4‿@⌽˘↕3‿4 !"Expected integer, got 0.5" % 0.5⊸⌽˘4‿3⥊↕12 -!"↑: Argument must have rank at least 1" % ↑˘↕2 -!"↓: Argument must have rank at least 1" % ↓⎉0 2‿1⥊0 -!"⊐: 𝕩 cannot have rank 0" % ⊐˘"abcd" -!"⊒: Argument cannot have rank 0" % ⊒˘"abcd" -!"∊: Argument cannot have rank 0" % ∊˘"abcd" -!"⍋: 𝕨 must be sorted" % 0‿2‿1⊸⍋˘ 3‿4⥊↕12 -!"`: Shape of 𝕨 must match the cell of 𝕩 (⟨2⟩ ≡ ≢𝕨, 2‿3 ≡ ≢𝕩)" % (2‿2⥊1)+`˘2‿2‿3⥊0.4 -!"`: Shape of 𝕨 must match the cell of 𝕩 (⟨⟩ ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % 2+`˘↕3‿3‿3 -!"´: Argument must be a list (3‿3 ≡ ≢𝕩)" % +´˘2‿3‿3⥊↕18 -!"´: 𝕩 must be a list (3‿3 ≡ ≢𝕩)" % 1+´˘2‿3‿3⥊↕18 -!"˝: 𝕩 must have rank at least 1" % +˝˘˘10‿10⥊↕100 -!"˝: 𝕩 must have rank at least 1" % ∾˝⎉¯2 2‿3⥊9 +!"↑𝕩: 𝕩 must have rank at least 1" % ↑˘↕2 +!"↓𝕩: 𝕩 must have rank at least 1" % ↓⎉0 2‿1⥊0 +!"⊐𝕩: 𝕩 cannot have rank 0" % ⊐˘"abcd" +!"⊒𝕩: 𝕩 cannot have rank 0" % ⊒˘"abcd" +!"∊𝕩: 𝕩 cannot have rank 0" % ∊˘"abcd" +!"𝕨⍋𝕩: 𝕨 must be sorted" % 0‿2‿1⊸⍋˘ 3‿4⥊↕12 +!"𝕨`𝕩: Shape of 𝕨 must match the cell of 𝕩 (⟨2⟩ ≡ ≢𝕨, 2‿3 ≡ ≢𝕩)" % (2‿2⥊1)+`˘2‿2‿3⥊0.4 +!"𝕨`𝕩: Shape of 𝕨 must match the cell of 𝕩 (⟨⟩ ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % 2+`˘↕3‿3‿3 +!"´𝕩: 𝕩 must be a list (3‿3 ≡ ≢𝕩)" % +´˘2‿3‿3⥊↕18 +!"𝕨´𝕩: 𝕩 must be a list (3‿3 ≡ ≢𝕩)" % 1+´˘2‿3‿3⥊↕18 +!"˝𝕩: 𝕩 must have rank at least 1" % +˝˘˘10‿10⥊↕100 +!"˝𝕩: 𝕩 must have rank at least 1" % ∾˝⎉¯2 2‿3⥊9 {∾˝˘ ⥊⟜(↕×´) 2+↕𝕩}¨ 2‿3‿4‿5 %% ⥊⟜(↕×´)¨ ⟨2‿3,2‿12,2‿12‿5,2‿12‿5‿6⟩ {∾˝˘ (2+↕𝕩)⥊<"hi"}¨ 2‿3‿4‿5 %% ⥊⟜(<"hi")¨ ⟨2‿3,2‿12,2‿12‿5,2‿12‿5‿6⟩ @@ -89,15 +89,15 @@ %USE eqvar ⋄ ¯1‿¯2‿¯3 {𝕨⊸⊏˘𝕩}_eqvar 8‿80⥊↕557 %% 8‿3⥊79‿78‿77‿159‿158‿157‿239‿238‿237‿319‿318‿317‿399‿398‿397‿479‿478‿477‿2‿1‿0‿82‿81‿80 1‿2‿0‿1‿¯1⊸⊏⎉1 2‿3‿4⥊↕24 %% 2‿3‿5⥊1‿2‿0‿1‿3‿5‿6‿4‿5‿7‿9‿10‿8‿9‿11‿13‿14‿12‿13‿15‿17‿18‿16‿17‿19‿21‿22‿20‿21‿23 1‿2‿0‿1‿¯1⊸⊏⎉2 2‿3‿4⥊↕24 %% 2‿5‿4⥊4‿5‿6‿7‿8‿9‿10‿11‿0‿1‿2‿3‿4‿5‿6‿7‿8‿9‿10‿11‿16‿17‿18‿19‿20‿21‿22‿23‿12‿13‿14‿15‿16‿17‿18‿19‿20‿21‿22‿23 -!"⊏: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % %USE evar ⋄ 0‿¯1‿1‿¯1 {𝕨⊸⊏˘𝕩}_evar ≍˘↕5 -!"⊏: Indexing out-of-bounds (¯2∊𝕨, 1≡≠𝕩)" % %USE evar ⋄ 0‿¯1‿¯2‿¯1 {𝕨⊸⊏˘𝕩}_evar ≍˘↕5 -!"⊏: Indexing out-of-bounds (¯129∊𝕨, 128≡≠𝕩)" % %USE evar ⋄ 10‿¯129 {𝕨⊸⊏˘𝕩}_evar 10‿128⥊1 -!"⊏: Indexing out-of-bounds (128∊𝕨, 128≡≠𝕩)" % %USE evar ⋄ 10‿128 {𝕨⊸⊏˘𝕩}_evar 10‿128⥊1 -!"⊏: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % %USE evar ⋄ 1‿0‿0‿1 {𝕨⊸⊏˘𝕩}_evar 10‿1⥊1 -!"⊏: Indexing out-of-bounds (1000∊𝕨, 3≡≠𝕩)" % %USE evar ⋄ (3⥊1000) {𝕨⊸⊏˘𝕩}_evar 100‿3⥊1 -!"⊏: Indexing out-of-bounds (1000∊𝕨, 4≡≠𝕩)" % %USE evar ⋄ (4⥊1000) {𝕨⊸⊏˘𝕩}_evar 100‿4⥊1 -!"⊏: Indexing out-of-bounds (1000∊𝕨, 8≡≠𝕩)" % %USE evar ⋄ (8⥊1000) {𝕨⊸⊏˘𝕩}_evar 100‿8⥊1 -!"⊏: Indexing out-of-bounds (100∊𝕨, 8≡≠𝕩)" % %USE evar ⋄ (<100) {𝕨⊸⊏˘𝕩}_evar 100‿8⥊1 +!"𝕨⊏𝕩: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % %USE evar ⋄ 0‿¯1‿1‿¯1 {𝕨⊸⊏˘𝕩}_evar ≍˘↕5 +!"𝕨⊏𝕩: Indexing out-of-bounds (¯2∊𝕨, 1≡≠𝕩)" % %USE evar ⋄ 0‿¯1‿¯2‿¯1 {𝕨⊸⊏˘𝕩}_evar ≍˘↕5 +!"𝕨⊏𝕩: Indexing out-of-bounds (¯129∊𝕨, 128≡≠𝕩)" % %USE evar ⋄ 10‿¯129 {𝕨⊸⊏˘𝕩}_evar 10‿128⥊1 +!"𝕨⊏𝕩: Indexing out-of-bounds (128∊𝕨, 128≡≠𝕩)" % %USE evar ⋄ 10‿128 {𝕨⊸⊏˘𝕩}_evar 10‿128⥊1 +!"𝕨⊏𝕩: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % %USE evar ⋄ 1‿0‿0‿1 {𝕨⊸⊏˘𝕩}_evar 10‿1⥊1 +!"𝕨⊏𝕩: Indexing out-of-bounds (1000∊𝕨, 3≡≠𝕩)" % %USE evar ⋄ (3⥊1000) {𝕨⊸⊏˘𝕩}_evar 100‿3⥊1 +!"𝕨⊏𝕩: Indexing out-of-bounds (1000∊𝕨, 4≡≠𝕩)" % %USE evar ⋄ (4⥊1000) {𝕨⊸⊏˘𝕩}_evar 100‿4⥊1 +!"𝕨⊏𝕩: Indexing out-of-bounds (1000∊𝕨, 8≡≠𝕩)" % %USE evar ⋄ (8⥊1000) {𝕨⊸⊏˘𝕩}_evar 100‿8⥊1 +!"𝕨⊏𝕩: Indexing out-of-bounds (100∊𝕨, 8≡≠𝕩)" % %USE evar ⋄ (<100) {𝕨⊸⊏˘𝕩}_evar 100‿8⥊1 !"Integer out of range: 9e99" % %USE evar ⋄ (<9e99) {𝕨⊸⊏˘𝕩}_evar 100‿8⥊1 ⟨1‿2⟩⊸⊏˘ 10‿8⥊↕100 %% (8×↕10) +⌜ 1‿2 ⟨1‿2⟩⊸⊏˘ 10‿4‿2⥊↕100 %% (8×↕10) +⌜ [2‿3,4‿5] @@ -131,15 +131,15 @@ %USE eqvar ⋄ ≍˘⟜'!' _eqvar 100⥊7↑1 %% ∾⟜'!'○•internal.Keep˘ 0=7|↕100 %USE eqvar ⋄ ≍˘_eqvar˜ 3‿3⥊↕9 %% 3‿2‿3⥊0‿1‿2‿0‿1‿2‿3‿4‿5‿3‿4‿5‿6‿7‿8‿6‿7‿8 %USE eqvar ⋄ (2‿3‿4‿5‿1⥊↕11) ≍⎉2 _eqvar 2‿3‿4‿5‿1⥊↕7 %% (2‿3‿4‿5‿1⥊↕11) ≍○•internal.PureKeep⎉2 2‿3‿4‿5‿1⥊↕7 -!"˘: Argument frames don't agree (3‿4 ≡ ≢𝕨, 5‿4 ≡ ≢𝕩, common frame of 1 axes)" % (3‿4⥊2) ≍˘ 5‿4⥊2 -!"≍: 𝕨 and 𝕩 must have equal shapes (⟨4⟩ ≡ ≢𝕨, ⟨5⟩ ≡ ≢𝕩)" % (3‿4⥊2) ≍˘ 3‿5⥊2 -!"≍: 𝕨 and 𝕩 must have equal shapes (2‿2‿2 ≡ ≢𝕨, 2‿3‿2 ≡ ≢𝕩)" % (3‿2‿2‿2⥊2) ≍˘ 3‿2‿3‿2⥊2 -!"≍: 𝕨 and 𝕩 must have equal shapes (4‿1 ≡ ≢𝕨, ⟨4⟩ ≡ ≢𝕩)" % (3‿4‿1⥊0) ≍˘ 3‿4⥊0 +!"𝕨˘𝕩: Argument frames don't agree (3‿4 ≡ ≢𝕨, 5‿4 ≡ ≢𝕩, common frame of 1 axes)" % (3‿4⥊2) ≍˘ 5‿4⥊2 +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (⟨4⟩ ≡ ≢𝕨, ⟨5⟩ ≡ ≢𝕩)" % (3‿4⥊2) ≍˘ 3‿5⥊2 +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (2‿2‿2 ≡ ≢𝕨, 2‿3‿2 ≡ ≢𝕩)" % (3‿2‿2‿2⥊2) ≍˘ 3‿2‿3‿2⥊2 +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (4‿1 ≡ ≢𝕨, ⟨4⟩ ≡ ≢𝕩)" % (3‿4‿1⥊0) ≍˘ 3‿4⥊0 (<"ab") ≍˘ 2⥊"cd" %% 2‿2⥊⟨"ab", 'c', "ab", 'd'⟩ (<"ab") ≍˘˜ 2⥊"cd" %% 2‿2⥊⟨'c', "ab", 'd', "ab"⟩ "ab" ≍⎉1 4‿2⥊"cd" %% 4‿2‿2⥊"abcdabcdabcdabcd" -!"≍: 𝕨 and 𝕩 must have equal shapes (⟨⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)" % ≍⟜"ab"˘ "cd" -!"≍: 𝕨 and 𝕩 must have equal shapes (⟨2⟩ ≡ ≢𝕨, ⟨⟩ ≡ ≢𝕩)" % "ab"⊸≍˘ "cd" +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (⟨⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)" % ≍⟜"ab"˘ "cd" +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (⟨2⟩ ≡ ≢𝕨, ⟨⟩ ≡ ≢𝕩)" % "ab"⊸≍˘ "cd" ( %USE IS_HEAPVERIFY diff --git a/test/cases/ffi.bqn b/test/cases/ffi.bqn index 543d02a1..fb0837bc 100644 --- a/test/cases/ffi.bqn +++ b/test/cases/ffi.bqn @@ -8,9 +8,9 @@ !"•FFI: 𝕩 must be a list" % @•FFI @ !"•FFI: 𝕩 must be a list" % @•FFI 2‿2⥊<"a" !"•FFI: Path must be a list of characters" % 1‿2 •FFI ""‿"bqn_init" -!"This function can't be called monadically" % •FFI ""‿"bqn_init" +!"Fn𝕩: This function can't be called monadically" % •FFI ""‿"bqn_init" @ •FFI⎊{𝕊: 28↑•CurrentError@} ""‿"bqn_this symbol doesn't exist" %% "FFI: Failed to find symbol: " -!"FFI: Type must be a string" % @•FFI "hello" +!"FFI𝕩: Type must be a string" % @•FFI "hello" !"FFI: Too many arguments" % @•FFI""‿"bqn_init"∾70000⥊<"i32" !"Type parser: Unexpected character '?'" % @•FFI""‿"bqn_init"‿"?" !"Type parser: expected number" % @•FFI""‿"bqn_init"‿"[" @@ -223,7 +223,7 @@ !"Expected integer, got character" % %USE WallocE {{𝕊al: p←"i8" Al 1 ⋄ p.Add '!'}} !"(pointer).Sub: Unexpected argument type: character" % %USE WallocE {{𝕊al: p←"i8" Al 1 ⋄ p.Sub '!'}} !"Expected non-negative integer, got character" % %USE WallocE {{𝕊al: p←"i8" Al 1 ⋄ p.Field '!'}} -!"Type parser: Pointer type must be a string" % %USE WallocE {{𝕊al: p←"i8" Al 1 ⋄ p.Cast '!'}} +!"Type parser𝕩: Pointer type must be a string" % %USE WallocE {{𝕊al: p←"i8" Al 1 ⋄ p.Cast '!'}} !"Expected integer, got character" % %USE WallocE {{𝕊al: p←"i8" Al 1 ⋄ p.Read '!'}} !"FFI: improper value for i8" % %USE WallocE {{𝕊al: p←"i8" Al 1 ⋄ p.Write '!'}} diff --git a/test/cases/hash.bqn b/test/cases/hash.bqn index f0e8826c..4284a802 100644 --- a/test/cases/hash.bqn +++ b/test/cases/hash.bqn @@ -38,12 +38,12 @@ a←(•ParseFloat¨ "1.2"‿"-0"‿"0")∾-⊸⋈0÷0 ⋄ ! (0‿3‿3‿3⊏a) {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 +!"𝕨∊𝕩: 𝕩 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⟩ @@ -54,10 +54,10 @@ a←(•ParseFloat¨ "1.2"‿"-0"‿"0")∾-⊸⋈0÷0 ⋄ ! (0‿3‿3‿3⊏a) (((•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𝕩: 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⟩ \ No newline at end of file +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⟩ diff --git a/test/cases/imports.bqn b/test/cases/imports.bqn index 8e585074..1a5cc283 100644 --- a/test/cases/imports.bqn +++ b/test/cases/imports.bqn @@ -17,11 +17,11 @@ ! (⊑¨r1‿r3) ≡ ⍷⊑¨r1‿r2‿r3‿r4 ) -!"•Import: cyclic import of "".../cyclic.bqn""" % %USE file ⋄ •Import⎊CleanPath File "cyclic.bqn" -!"•Import: cyclic import of "".../cyclic.bqn""" % %USE file ⋄ •Import⎊CleanPath File "cyclic.bqn" -!"•Import: cyclic import of "".../cyclic.bqn""" % %USE file ⋄ ⟨⟩•Import⎊CleanPath File "cyclic.bqn" -!"•Import: cyclic import of "".../cyclic_A.bqn""" % %USE file ⋄ •Import⎊CleanPath File "cyclic_A.bqn" -!"•Import: cyclic import of "".../cyclic_B.bqn""" % %USE file ⋄ •Import⎊CleanPath File "cyclic_B.bqn" -!"•Import: cyclic import of "".../cyclic_A.bqn""" % %USE file ⋄ ⟨⟩•Import⎊CleanPath File "cyclic_B.bqn" -!"•Import: cyclic import of "".../cyclic_B.bqn""" % %USE file ⋄ ⟨⟩•Import⎊CleanPath File "cyclic_A.bqn" +!"•Import𝕩: cyclic import of "".../cyclic.bqn""" % %USE file ⋄ •Import⎊CleanPath File "cyclic.bqn" +!"•Import𝕩: cyclic import of "".../cyclic.bqn""" % %USE file ⋄ •Import⎊CleanPath File "cyclic.bqn" +!"•Import𝕩: cyclic import of "".../cyclic.bqn""" % %USE file ⋄ ⟨⟩•Import⎊CleanPath File "cyclic.bqn" +!"•Import𝕩: cyclic import of "".../cyclic_A.bqn""" % %USE file ⋄ •Import⎊CleanPath File "cyclic_A.bqn" +!"•Import𝕩: cyclic import of "".../cyclic_B.bqn""" % %USE file ⋄ •Import⎊CleanPath File "cyclic_B.bqn" +!"•Import𝕩: cyclic import of "".../cyclic_A.bqn""" % %USE file ⋄ ⟨⟩•Import⎊CleanPath File "cyclic_B.bqn" +!"•Import𝕩: cyclic import of "".../cyclic_B.bqn""" % %USE file ⋄ ⟨⟩•Import⎊CleanPath File "cyclic_A.bqn" %USE file ⋄ 3 •Import File "notCyclic.bqn" %% 30 diff --git a/test/cases/patterns.bqn b/test/cases/patterns.bqn index df6d57eb..24849776 100644 --- a/test/cases/patterns.bqn +++ b/test/cases/patterns.bqn @@ -16,7 +16,7 @@ !"Calling a modifier" % 4 {˜}˝↕1 !"Calling a modifier" % 4 {∘}`↕1 !"Calling a modifier" % {∘}¨↕1 -!"Cannot call a modifier" % {˜}¨˜↕1 +!"𝕨_Mod_𝕩: Cannot call a modifier" % {˜}¨˜↕1 4 {˜}˙´↕1 %% ˜ 4 {˜}˙˝↕1 %% ˜ 4 {∘}˙`↕1 %% ⟨∘⟩ diff --git a/test/cases/prims.bqn b/test/cases/prims.bqn index d88d50f5..f35613b8 100644 --- a/test/cases/prims.bqn +++ b/test/cases/prims.bqn @@ -10,8 +10,8 @@ # total array comparison %USE k ⋄ a ← 0‿@‿'a'‿∞‿¯∞‿1‿¯1∾⍷∾{⟨𝕩⥊0, 𝕩⥊1, {1⌾((¯1¨≢𝕩)⊸⊑)𝕩}⍟(0≠×´∘≢) 𝕩⥊0⟩}¨ ∾{⥊(<⟨⟩)∾⌜´𝕩⥊<↕3}¨↕4 ⋄ r←(⊑(⍋-⍒)∘⋈)_k⌜˜ a ⋄ ! r ≡ •Cmp⌜˜a ⋄ r %% '1'-˜73‿73⥊"1000202002000002222000002000000222222222222200000200000022220000002000000210222222222222222222222222222222222222222222222222222222222222222222222222122222222222222222222222222222222222222222222222222222222222222222222222001222222222222222222222222222222222222222222222222222222222222222222222000010000200000222200000200000022222222222220000020000002222000000200000020002122022020222222020222022022222222222222202022202202222220220222022020000201002000002222000002000000222222222222200000200000022220000002000000200020210200000222200000200000022222222222220000020000002222000000200000020002222122020222222020222022022222222222222202022202202222220220222022020000000001000000000000000000000000000000000000000000000000000000000000000200020220210000222200000200000022222222222220000020000002222000000200000020002222222120222222020222022022222222222222202022202202222220220222022022000202202201002222200002202000222222222222220000220200022222020002202000200022222222212222222202222220222222222222222220222222022222222202222220220002022022020122222020022022022222222222222202002202202222220220222022020000000002000001000000000000000000000000000000000000000000000000000000000000000000200000210200000200000020020020020020000020000002002000000200000000000000020000022120000020000002202202202202000002000000220200000020000000000000002000002001000000000000200000000200000000000000020000000000000000200020220220000222210000200000022222222222220000020000002222000000200000020002222222220222222120222022022222222222222202022202202222220220222022022000202202202002222201002202000222222222222220000220200022222020002202000200022222222222222222212222220222222222222222220222222022222222202222220220002022022020222222020122022022222222222222202002202202222220220222022020000000002000002002000001000000200200000200200000000000020020000000000000200020220220000222220000210000022222222222222000020000002222202000200000020002222222220222222220222122022222222222222222022202202222222220222022022000202202200002222200002201000222222222222220000220000022222020002202000200020220220200222220200220210022222222222222020022020002222202202220200020002222222222222222222222222122222222222222222222222202222222222222222022000202202202002222202002202201222222222222220200220220022222022022202202000000000200000200000000000000010000000000000000000000000000000000000000000000000020000022020000020000002102002002002000002000000200200000020000000000000002000002222000002000000221220220220200000200000022020000002000000000000000200000200200000000000020010000020000000000000002000000000000000000000000020000022020000020000002202102002202000002000000220200000020000000000000002000002222000002000000222221220222200000200000022220000002000000000000000200000200200000200000020020010020020000000000002002000000000000000000000020000022020000020000002202202102202000002000000220200000020000000000000002000002222000002000000222222221222200000200000022220000002000000000000000200000200000000000000020000000010000000000000000000000000000000000000000020000022020000020000002202002002102000002000000200200000020000000000000002000002222000002000000222220220221200000200000022020000002000000000000000200000200200000000000020020000020010000000000002000000000000000020002022022000022222000020000002222222222222100002000000222200000020000002000222222222022222222022202202222222222222221202220220222222022022202202200020220220200222220200220200022222222222222010022020002222202000220200020002222222222222222222222222022222222222222222122222202222222220222222022000202202202022222202022202202222222222222220201220220222222022022202202000000000200000200200000200000020020020020020000010000002002000000000000020002022022000022222000022000002222222222222200002100000222220200020000002000222222222022222222022222202222222222222222202221220222222222022202202200020220220000222220000220200022222222222222000022010002222202000220200020002022022020022222020022022002222222222222202002202100222220220222020002000222222222222222222222222222222222222222222222222221222222222222222202200020220220200222220200220220222222222222222020022022012222202202220220200000000020000020000000000000002000000002000000000000000100000000000000000000000002000002202000002000000220200200220200000200000021020000002000000000000000200000222200000200000022222022022220000020000002212000000200000000000000020000020020000000000002002000002002000000000000200100000000000002000202202200002222200002000000222222222222220000200000022221000002000000200022222222202222222202220220222222222222222220222022022222212202220220220002022022000022222000020000002222222222222200002000000222220100020000002000202202202002222202002202000222222222222220200220200022222021002202000200022222222222222222222222220222222222222222222222222022222222212222220220002022022020022222020022020002222222222222202002202000222220220122020000000000002000002002000002000000200200200200200000200000020020000001000000200020220220000222220000220000022222222222222000022000002222202000210000020002222222220222222220222222022222222222222222022222202222222220222122022000202202200002222200002200000222222222222220000220000022222020002201000200020220220200222220200220220022222222222222020022022002222202202220210020002222222222222222222222222222222222222222222222222222222222222222222122000202202202002222202002202200222222222222220200220220022222022022202201" -!"∧: Argument cannot have rank 0" % ∧@ -!"∨: Argument cannot have rank 0" % ∨@ +!"∧𝕩: 𝕩 cannot have rank 0" % ∧@ +!"∨𝕩: 𝕩 cannot have rank 0" % ∨@ (=⋈≡)˜{⇐} %% 1‿1 (≠⋈≢)˜{⇐} %% 0‿0 {⇐}(=⋈≡){⇐} %% 0‿0 @@ -60,7 +60,7 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expe 1 +<1 %% <2 (<1)+<1 %% <2 @-@ %% 0 -!"-: Invalid character" % @-1 +!"𝕨-𝕩: Invalid character" % @-1 {r←•Repr𝕩 ⋄ (⊢!≡´) (r∾": Unexpected argument types") ⋈ @ 0∘𝕏⎊{𝕊: •CurrentError@} @}¨ ⟨+, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ {r←•Repr𝕩 ⋄ (⊢!≡´) (r∾": Unexpected argument types") ⋈ 0 0∘𝕏⎊{𝕊: •CurrentError@} @}¨ ⟨ -, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ {r←•Repr𝕩 ⋄ (⊢!≡´) (r∾": Unexpected argument types") ⋈ @ 0∘𝕏⎊{𝕊: •CurrentError@} 0}¨ ⟨ ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ @@ -77,12 +77,12 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expe %USE var ⋄ a←4⥊0 ⋄ b←4⥊@ ⋄ {r←•Repr f←𝕩 ⋄ {(⊢!≡´) (r∾": Unexpected argument types") ⋈ (𝕨 V a) 0∘F⎊{𝕊: •CurrentError@} 𝕩 V b}⌜○LV´ a‿b}⌜ ⟨ -, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ %USE var ⋄ a←4⥊@ ⋄ b←4⥊0 ⋄ {r←•Repr f←𝕩 ⋄ {(⊢!≡´) (r∾": Unexpected argument types") ⋈ (𝕨 V a) 0∘F⎊{𝕊: •CurrentError@} 𝕩 V b}⌜○LV´ a‿b}⌜ ⟨ ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ -!"-: Unexpected argument types" % 0-@ -!"÷: Unexpected argument types" % 0÷@ -!"+: Argument must consist of numbers" % +@ +!"𝕨-𝕩: Unexpected argument types" % 0-@ +!"𝕨÷𝕩: Unexpected argument types" % 0÷@ +!"+𝕩: Argument must consist of numbers" % +@ ⟨@, "abc", ⟨1,2,+⟩, {⇐}⟩ {(⊢!≡´) (": Argument contained non-number"∾˜•Repr 𝕩) ⋈ 0∘𝕏⎊{𝕊: •CurrentError@} 𝕨}⌜ -‿×‿÷‿⋆‿√‿⌊‿⌈‿|‿¬ -!"This function can't be called monadically" % ≤@ -!"This function can't be called monadically" % ≥@ +!"Fn𝕩: This function can't be called monadically" % ≤@ +!"Fn𝕩: This function can't be called monadically" % ≥@ # 𝕨/𝕩 2‿3‿0‿1/4‿3⥊↕⋈12 %% ⋈¨6‿3⥊0‿1‿2‿0‿1‿2‿3‿4‿5‿3‿4‿5‿3‿4‿5‿9‿10‿11 @@ -90,7 +90,7 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expe 2‿3‿0‿1/↕⋈4 %% ⋈¨6⥊0‿0‿1‿1‿1‿3 !"Expected non-negative integer, got ¯3" % 2‿¯3/↕2 !"Expected non-negative integer, got ¯3e20" % 2‿¯3e20/↕2 -!"/: Lengths of components of 𝕨 must match 𝕩 (3 ≠ 4)" % 1‿2‿3/4‿5‿6‿7 +!"𝕨/𝕩: Lengths of components of 𝕨 must match 𝕩 (3 ≠ 4)" % 1‿2‿3/4‿5‿6‿7 !"Expected non-negative integer, got ¯1000" % (4/1000‿¯1000) / 8⥊1 !"Expected non-negative integer, got ¯1000" % (4/1000‿¯1000) / 8⥊1 !"Integer out of range: 4e19" % %USE evar ⋄ 2‿4e19 /_evar ↕2 @@ -101,9 +101,9 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expe !"𝕨/𝕩: Length of compound 𝕨 must be at most rank of 𝕩" % (<↕0)/<"ab" !"𝕨/𝕩: Length of compound 𝕨 must be at most rank of 𝕩" % ⟨↕10,↕10⟩ / 10⥊10 !"𝕨/𝕩: Length of compound 𝕨 must be at most rank of 𝕩" % ⟨↕10,↕10,<0⟩ / 10‿10⥊10 -!"/: Simple 𝕨 must have rank 0 or 1 (2≡=𝕨)" % (2‿1⥊↕4) / 4‿4⥊↕16 +!"𝕨/𝕩: Simple 𝕨 must have rank 0 or 1 (2≡=𝕨)" % (2‿1⥊↕4) / 4‿4⥊↕16 !"𝕨/𝕩: Compound 𝕨 must have rank at most 1" % (2‿1⥊<↕4) / 4‿4⥊↕16 -!"/: Simple 𝕨 must have rank 0 or 1 (2≡=𝕨)" % (1‿2⥊↕4) / ↕4 +!"𝕨/𝕩: Simple 𝕨 must have rank 0 or 1 (2≡=𝕨)" % (1‿2⥊↕4) / ↕4 !"𝕨/𝕩: Compound 𝕨 must have rank at most 1" % (1‿2⥊<↕4) / ↕4 !"𝕨/𝕩: 𝕨 must consist of natural numbers" % ⟨↕4, 1‿2‿3.5‿4⟩ / 4‿4⥊↕16 !"𝕨/𝕩: 𝕨 must consist of natural numbers" % ⟨↕4, 3.5⟩ / 4‿4⥊↕16 @@ -123,8 +123,8 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expe # /𝕩 !"Expected non-negative integer, got ¯1000" % / 4/1000‿¯1000 -!"/: Argument must have rank 1 (3‿3 ≡ ≢𝕩)" % /↕3‿3 -!"/: Argument must have rank 1 (⟨⟩ ≡ ≢𝕩)" % /0 +!"/𝕩: 𝕩 must have rank 1 (3‿3 ≡ ≢𝕩)" % /↕3‿3 +!"/𝕩: 𝕩 must have rank 1 (⟨⟩ ≡ ≢𝕩)" % /0 !"Expected non-negative integer, got ¯1" % %USE evar ⋄ /_evar ¯1⌾(100⊸⊑) 200⥊10 !"Sum too big" % %USE evar ⋄ /_evar 1e2⥊2⋆62 !"Integer out of range: 1e20" % %USE evar ⋄ /_evar 1e20⌾(100⊸⊑) 200⥊10 @@ -135,38 +135,38 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expe •internal.ElType¨ {(100⥊↕2)⊏𝕨‿𝕩}⌜˜ ⟨0, 1, 2, 127, 128, 32767, 32768, ¯32767, ¯32768, ¯32769, ¯1+2⋆31, 2⋆31, @, @+1, @+255, @+256, @+1114111, {⇐}, 1‿2⟩ %% (8-(=⌜˜<⟜5)×8-⌈⌜˜) 0‿0‿1‿1‿2‿2‿3‿2‿2‿3‿3‿4‿5‿5‿5‿6‿7‿8‿8 0‿0‿0 ⊏ 1‿3⥊↕10 %% 3‿3⥊0‿1‿2 ≢¨ ⟨(2‿0‿3‿4‿5⥊1)⊏9‿8‿0‿7⥊0 ⋄ ⟨⟩⊏0‿8‿0‿7⥊0 ⋄ (2‿3‿0‿4⥊1)⊏↕10⟩ %% ⟨2‿0‿3‿4‿5‿8‿0‿7,0‿8‿0‿7,2‿3‿0‿4⟩ -!"⊏: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % ⊏˜(200⥊1)⥊1 -!"⊏: Indexing out-of-bounds (24∊𝕨, 4≡≠𝕩)" % %USE evar ⋄ 1‿24 ⊏_evar ↕4‿4 -!"⊏: Indexing out-of-bounds (¯24∊𝕨, 4≡≠𝕩)" % %USE evar ⋄ 1‿¯24 ⊏_evar ↕4‿4 +!"𝕨⊏𝕩: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % ⊏˜(200⥊1)⥊1 +!"𝕨⊏𝕩: Indexing out-of-bounds (24∊𝕨, 4≡≠𝕩)" % %USE evar ⋄ 1‿24 ⊏_evar ↕4‿4 +!"𝕨⊏𝕩: Indexing out-of-bounds (¯24∊𝕨, 4≡≠𝕩)" % %USE evar ⋄ 1‿¯24 ⊏_evar ↕4‿4 !"𝕨⊏𝕩: 𝕨 must be an array of numbers or list of such arrays" % %USE evar ⋄ (1‿¯26∾@) ⊏_evar @∾↕5 -!"⊏: Indexing out-of-bounds (¯26∊𝕨, 5≡≠𝕩)" % %USE evar ⋄ ¯26⊸⊏_evar ↕5 +!"𝕨⊏𝕩: Indexing out-of-bounds (¯26∊𝕨, 5≡≠𝕩)" % %USE evar ⋄ ¯26⊸⊏_evar ↕5 !"Expected integer, got ¯26.5" % %USE evar ⋄ ¯26.5⊸⊏_evar ↕5 -!"⊏: Indexing out-of-bounds (¯26∊𝕨, 5≡≠𝕩)" % %USE evar ⋄ 1‿¯26 ⊏_evar ↕5 -!"⊏: Indexing out-of-bounds (26∊𝕨, 5≡≠𝕩)" % %USE evar ⋄ 1‿26 ⊏_evar ↕5 +!"𝕨⊏𝕩: Indexing out-of-bounds (¯26∊𝕨, 5≡≠𝕩)" % %USE evar ⋄ 1‿¯26 ⊏_evar ↕5 +!"𝕨⊏𝕩: Indexing out-of-bounds (26∊𝕨, 5≡≠𝕩)" % %USE evar ⋄ 1‿26 ⊏_evar ↕5 !"Expected integer, got 1.1" % %USE evar ⋄ 0‿1.1‿2 ⊏_evar ↕10 -!"⊏: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % %USE evar ⋄ 0‿0‿1 ⊏_evar 1‿3⥊↕10000 -!"⊏: Indexing out-of-bounds (2∊𝕨, 2≡≠𝕩)" % %USE evar ⋄ (1+9=↕10) ⊏_evar ⟨1‿2,3⟩ -!"⊏: Indexing out-of-bounds (4∊𝕨, 3≡≠𝕩)" % %USE evar ⋄ 1‿4‿2‿0‿10‿5‿6 ⊏_evar 1‿0‿1 -!"⊏: Indexing out-of-bounds (¯4∊𝕨, 3≡≠𝕩)" % %USE evar ⋄ (-1‿4‿2‿0‿10‿5‿6) ⊏_evar 1‿0‿1 -!"⊏: Indexing out-of-bounds (4000∊𝕨, 1001≡≠𝕩)" % %USE evar ⋄ ( 1000×1‿4‿2‿0‿10‿5‿6) ⊏_evar 1001⥊1‿0‿1 -!"⊏: Indexing out-of-bounds (¯4000∊𝕨, 1001≡≠𝕩)" % %USE evar ⋄ (¯1000×1‿4‿2‿0‿10‿5‿6) ⊏_evar 1001⥊1‿0‿1 +!"𝕨⊏𝕩: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % %USE evar ⋄ 0‿0‿1 ⊏_evar 1‿3⥊↕10000 +!"𝕨⊏𝕩: Indexing out-of-bounds (2∊𝕨, 2≡≠𝕩)" % %USE evar ⋄ (1+9=↕10) ⊏_evar ⟨1‿2,3⟩ +!"𝕨⊏𝕩: Indexing out-of-bounds (4∊𝕨, 3≡≠𝕩)" % %USE evar ⋄ 1‿4‿2‿0‿10‿5‿6 ⊏_evar 1‿0‿1 +!"𝕨⊏𝕩: Indexing out-of-bounds (¯4∊𝕨, 3≡≠𝕩)" % %USE evar ⋄ (-1‿4‿2‿0‿10‿5‿6) ⊏_evar 1‿0‿1 +!"𝕨⊏𝕩: Indexing out-of-bounds (4000∊𝕨, 1001≡≠𝕩)" % %USE evar ⋄ ( 1000×1‿4‿2‿0‿10‿5‿6) ⊏_evar 1001⥊1‿0‿1 +!"𝕨⊏𝕩: Indexing out-of-bounds (¯4000∊𝕨, 1001≡≠𝕩)" % %USE evar ⋄ (¯1000×1‿4‿2‿0‿10‿5‿6) ⊏_evar 1001⥊1‿0‿1 %USE tvar ⋄ !∘≡¨⟜⊏ ∾ {⥊𝕨 ⊏⎊(•CurrentError∘⊢) _tvar 𝕩}´¨ ⟨⟨0‿1, ⋈0⟩ ⋄ ⟨0‿1, "?"⟩ ⋄ ⟨0‿1, ≍0‿1⟩⟩ a←↕2 ⋄ ! "e" ≡ (↕10){b←a‿a‿a‿a‿a‿a‿a‿a‿a‿a ⋄ 𝕨⊏⎊"e"𝕩}⟨1‿2,3‿4⟩ ⋄ ! 0‿1 ≡ a %USE eqvar ⋄ {1‿¯1 {r←𝕨⊏𝕩 ⋄ ! 𝕩 ≥○•internal.ElType r ⋄ r}_eqvar 𝕩}¨ ⟨↕2, ↕4, "hello", ⟨"ab", "cd", "ef"⟩, ↕⋈4⟩ -!"⊏: 𝕩 cannot be a unit" % 0⊏<"a" -!"⊏: 𝕩 cannot be a unit" % 0⊏<5 -!"⊏: 𝕩 cannot be an atom" % 0⊏5 -!"⊏: 𝕩 cannot be a unit" % ⟨⟩⊏<"a" -!"⊏: 𝕩 cannot be a unit" % ⟨⟩⊏<5 -!"⊏: 𝕩 cannot be an atom" % ⟨⟩⊏5 +!"𝕨⊏𝕩: 𝕩 cannot be a unit" % 0⊏<"a" +!"𝕨⊏𝕩: 𝕩 cannot be a unit" % 0⊏<5 +!"𝕨⊏𝕩: 𝕩 cannot be an atom" % 0⊏5 +!"𝕨⊏𝕩: 𝕩 cannot be a unit" % ⟨⟩⊏<"a" +!"𝕨⊏𝕩: 𝕩 cannot be a unit" % ⟨⟩⊏<5 +!"𝕨⊏𝕩: 𝕩 cannot be an atom" % ⟨⟩⊏5 !"Expected integer, got 1.5" % ⟨1.5⟩ ⊏ "ab"‿"cd" -!"⊏: Indexing out-of-bounds (10∊𝕨, 2≡≠𝕩)" % ⟨10⟩ ⊏ "ab"‿"cd" +!"𝕨⊏𝕩: Indexing out-of-bounds (10∊𝕨, 2≡≠𝕩)" % ⟨10⟩ ⊏ "ab"‿"cd" {𝕩 ! ↕∘≠⊸⊏⊸≡ 20‿𝕩•rand.Range 2}¨ (↕70)∾⥊(64×1‿2‿3‿4‿5)+⌜¯1‿0‿1‿30‿60 # 𝕨⊑𝕩 -!"⊑: 𝕨 contained a non-integer" % ⟨0.1⟩⊑↕3 -!"⊑: 𝕨 contained a non-integer" % ⟨2⋆80⟩⊑↕3 -!"⊑: Leaf arrays in 𝕨 must have rank 1 (element: (1‿2⥊1‿2))" % %USE evar ⋄ (≍1‿2) {⟨𝕨⟩⊑𝕩}_evar ↕5‿5 +!"𝕨⊑𝕩: 𝕨 contained a non-integer" % ⟨0.1⟩⊑↕3 +!"𝕨⊑𝕩: 𝕨 contained a non-integer" % ⟨2⋆80⟩⊑↕3 +!"𝕨⊑𝕩: Leaf arrays in 𝕨 must have rank 1 (element: (1‿2⥊1‿2))" % %USE evar ⋄ (≍1‿2) {⟨𝕨⟩⊑𝕩}_evar ↕5‿5 %USE eqvar ⋄ 1‿2 ⊑_eqvar ↕5‿5 %% 1‿2 # >𝕩 @@ -179,8 +179,8 @@ a←↕2 ⋄ ! "e" ≡ (↕10){b←a‿a‿a‿a‿a‿a‿a‿a‿a‿a ⋄ !">: Incompatible element shapes (encountered shapes ⟨0⟩ and ⟨⟩)" % > ↕¨⟨0, ⟨⟩⟩ !">: Incompatible element shapes (encountered shapes 2‿3 and ⟨⟩)" % > ↕¨⟨2‿3, ⟨⟩⟩ !">: Incompatible element shapes (encountered shapes 4‿5 and 4‿6)" % ≢>2‿3⥊⟨4‿5⥊↕20,4‿6⥊↕1⟩ -!"∾: Item trailing shapes must be equal (contained arrays with shapes ⟨2⟩ and ⟨3⟩ and later higher-rank array)" % ∾⟨1‿1, 1‿1‿1, ⟨1⟩, 2‿2⥊1⟩ -!"∾: Item trailing shapes must be equal (contained arrays with shapes 1‿4 and ⟨0⟩)" % ∾⟨1‿4⥊"abcd",⟨⟩⟩ +!"∾𝕩: Item trailing shapes must be equal (contained arrays with shapes ⟨2⟩ and ⟨3⟩ and later higher-rank array)" % ∾⟨1‿1, 1‿1‿1, ⟨1⟩, 2‿2⥊1⟩ +!"∾𝕩: Item trailing shapes must be equal (contained arrays with shapes 1‿4 and ⟨0⟩)" % ∾⟨1‿4⥊"abcd",⟨⟩⟩ >⟨<'a',1⟩ %% 'a'‿1 >⟨1,2,<3,4,<<5⟩ %% ⟨1,2,3,4,<5⟩ ≢>0‿1⥊<2‿3⥊<"ab" %% ↕4 @@ -204,11 +204,11 @@ a←↕2 ⋄ ! "e" ≡ (↕10){b←a‿a‿a‿a‿a‿a‿a‿a‿a‿a ⋄ # ∾𝕩 ∾⟨"ab", 12, "de"⟩ %% ⟨'a','b',12,'d','e'⟩ -!"∾: Item trailing shapes must be equal (contained arrays with shapes 3‿3 and 3‿4)" % ∾⟨↕3‿3,↕3‿4⟩ -!"∾: Item trailing shapes must be equal (contained arrays with shapes ⟨2⟩ and 3‿3)" % ∾⟨1‿2,↕3‿3⟩ -!"∾: Item ranks along an axis can differ by at most one (contained ranks 1 and 3 along axis 0)" % ∾2‿1 ⥊ ⥊⟜0¨ ⟨0‿2‿3, 0⟩ -!"∾: Incompatible item shapes (contained arrays with shapes 1‿0 and 1‿0 along axis 1)" % ∾ {1‿𝕩⥊0}¨ [0‿1, 0‿0] -!"∾: Incompatible item ranks" % ∾ ⥊⟜0¨ [0‿1⋈0‿1, 0‿1⋈1] +!"∾𝕩: Item trailing shapes must be equal (contained arrays with shapes 3‿3 and 3‿4)" % ∾⟨↕3‿3,↕3‿4⟩ +!"∾𝕩: Item trailing shapes must be equal (contained arrays with shapes ⟨2⟩ and 3‿3)" % ∾⟨1‿2,↕3‿3⟩ +!"∾𝕩: Item ranks along an axis can differ by at most one (contained ranks 1 and 3 along axis 0)" % ∾2‿1 ⥊ ⥊⟜0¨ ⟨0‿2‿3, 0⟩ +!"∾𝕩: Incompatible item shapes (contained arrays with shapes 1‿0 and 1‿0 along axis 1)" % ∾ {1‿𝕩⥊0}¨ [0‿1, 0‿0] +!"∾𝕩: Incompatible item ranks" % ∾ ⥊⟜0¨ [0‿1⋈0‿1, 0‿1⋈1] ∾3‿3⥊<1‿0‿3⥊0 %% 3‿0‿3⥊0 ∾3‿3⥊<0‿0⥊⟨⟩ %% 0‿0⥊⟨⟩ ⊑1↑⥊∾3‿3⥊<1‿0‿3⥊<"hi" %% " " @@ -216,8 +216,8 @@ a←↕2 ⋄ ! "e" ≡ (↕10){b←a‿a‿a‿a‿a‿a‿a‿a‿a‿a ⋄ ∾⟨⟩ %% ⟨⟩ # 𝕨∾𝕩 -!"∾: Lengths not matchable (⟨6⟩ ≡ ≢𝕨, 1‿1 ≡ ≢𝕩)" % ("abc"∾"def")∾≍"a" -!"∾: Lengths not matchable (⟨6⟩ ≡ ≢𝕨, 1‿1 ≡ ≢𝕩)" % (("abc")∾"def")∾1‿1⥊1 +!"𝕨∾𝕩: Lengths not matchable (⟨6⟩ ≡ ≢𝕨, 1‿1 ≡ ≢𝕩)" % ("abc"∾"def")∾≍"a" +!"𝕨∾𝕩: Lengths not matchable (⟨6⟩ ≡ ≢𝕨, 1‿1 ≡ ≢𝕩)" % (("abc")∾"def")∾1‿1⥊1 ! (∘‿2⥊"abcdefgh") ≡ ["ab","cd"]∾["ef","gh"] ! (∘‿2⥊"abcdef") ≡ ["ab","cd"]∾"ef" @@ -226,26 +226,26 @@ a←↕2 ⋄ ! "e" ≡ (↕10){b←a‿a‿a‿a‿a‿a‿a‿a‿a‿a ⋄ ! (∘‿2⥊"abcdef") ≡ (a←["ab","cd"])∾"ef" ⋄ •internal.Keep a ! (∘‿2⥊"abcdef") ≡ "ab"∾a←["cd","ef"] ⋄ •internal.Keep a -!"∾: Argument ranks must differ by 1 or less (0≡=𝕨, 2≡=𝕩)" % 1∾↕3‿3 -!"∾: Argument ranks must differ by 1 or less (1≡=𝕨, 3≡=𝕩)" % 1‿2∾↕3‿3‿3 -!"∾: Argument ranks must differ by 1 or less (3≡=𝕨, 1≡=𝕩)" % 1‿2∾˜↕3‿3‿3 -!"∾: Lengths not matchable (3‿4 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (↕3‿4)∾↕3‿3 +!"𝕨∾𝕩: Argument ranks must differ by 1 or less (0≡=𝕨, 2≡=𝕩)" % 1∾↕3‿3 +!"𝕨∾𝕩: Argument ranks must differ by 1 or less (1≡=𝕨, 3≡=𝕩)" % 1‿2∾↕3‿3‿3 +!"𝕨∾𝕩: Argument ranks must differ by 1 or less (3≡=𝕨, 1≡=𝕩)" % 1‿2∾˜↕3‿3‿3 +!"𝕨∾𝕩: Lengths not matchable (3‿4 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (↕3‿4)∾↕3‿3 -!"∾: Lengths not matchable (2‿2 ≡ ≢𝕨, 2‿3 ≡ ≢𝕩)" % ["ab","cd"]∾["efg","hjk"] -!"∾: Lengths not matchable (2‿2 ≡ ≢𝕨, ⟨3⟩ ≡ ≢𝕩)" % ["ab","cd"]∾"efg" -!"∾: Lengths not matchable (⟨3⟩ ≡ ≢𝕨, 2‿2 ≡ ≢𝕩)" % "abz"∾["cd","ef"] -!"∾: Lengths not matchable (2‿2 ≡ ≢𝕨, 2‿3 ≡ ≢𝕩)" % (a←["ab","cd"])∾["efg","hjk"] -!"∾: Lengths not matchable (2‿2 ≡ ≢𝕨, ⟨3⟩ ≡ ≢𝕩)" % (a←["ab","cd"])∾"efg" -!"∾: Lengths not matchable (⟨3⟩ ≡ ≢𝕨, 2‿2 ≡ ≢𝕩)" % "abz"∾a←["cd","ef"] +!"𝕨∾𝕩: Lengths not matchable (2‿2 ≡ ≢𝕨, 2‿3 ≡ ≢𝕩)" % ["ab","cd"]∾["efg","hjk"] +!"𝕨∾𝕩: Lengths not matchable (2‿2 ≡ ≢𝕨, ⟨3⟩ ≡ ≢𝕩)" % ["ab","cd"]∾"efg" +!"𝕨∾𝕩: Lengths not matchable (⟨3⟩ ≡ ≢𝕨, 2‿2 ≡ ≢𝕩)" % "abz"∾["cd","ef"] +!"𝕨∾𝕩: Lengths not matchable (2‿2 ≡ ≢𝕨, 2‿3 ≡ ≢𝕩)" % (a←["ab","cd"])∾["efg","hjk"] +!"𝕨∾𝕩: Lengths not matchable (2‿2 ≡ ≢𝕨, ⟨3⟩ ≡ ≢𝕩)" % (a←["ab","cd"])∾"efg" +!"𝕨∾𝕩: Lengths not matchable (⟨3⟩ ≡ ≢𝕨, 2‿2 ≡ ≢𝕩)" % "abz"∾a←["cd","ef"] # 𝕨≍𝕩 -!"≍: 𝕨 and 𝕩 must have equal shapes (3‿4 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (↕3‿4)≍↕3‿3 -!"≍: 𝕨 and 𝕩 must have equal shapes (⟨3⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)" % 1‿2‿3≍1‿2 -!"≍: 𝕨 and 𝕩 must have equal shapes (⟨3⟩ ≡ ≢𝕨, ⟨⟩ ≡ ≢𝕩)" % 1‿2‿3≍1 -!"≍: Result rank too large" % ≍˜(255⥊1)⥊1 +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (3‿4 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (↕3‿4)≍↕3‿3 +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (⟨3⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)" % 1‿2‿3≍1‿2 +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (⟨3⟩ ≡ ≢𝕨, ⟨⟩ ≡ ≢𝕩)" % 1‿2‿3≍1 +!"𝕨≍𝕩: Result rank too large" % ≍˜(255⥊1)⥊1 # ≍𝕩 -!"≍: Result rank too large (255≡=𝕩)" % ≍⍟256 1 +!"≍𝕩: Result rank too large (255≡=𝕩)" % ≍⍟256 1 %USE eqvar ⋄ 1‿2‿3‿4‿5‿64 {c𝕊e: ∾_eqvar´¨ ⟨4‿c, c⟩ ⋈⌜○({𝕩⥊ %% +‿÷‿×‿=‿+‿+ -!"/: Lengths of components of 𝕨 must match 𝕩 (6 ≠ 7)" % 0¨⌾(1‿0‿0‿0‿1‿1⊸/) 0‿1‿0‿1‿0‿1‿0 +!"𝕨/𝕩: Lengths of components of 𝕨 must match 𝕩 (6 ≠ 7)" % 0¨⌾(1‿0‿0‿0‿1‿1⊸/) 0‿1‿0‿1‿0‿1‿0 4↑ (⋈⋈3)⌾(0‿1‿0⊸/) ↕⋈3 %!PROPER_FILLS %% ⟨⋈0,⋈3,⋈2,0⟩ 4↑ ⊢⌾(0‿1‿0⊸/) ↕⋈3 %!PROPER_FILLS %% ⟨⋈0,⋈1,⋈2,0⟩ 4↑ ⊢⌾(0‿0‿0⊸/) ↕⋈3 %!PROPER_FILLS %% ⟨⋈0,⋈1,⋈2,0⟩