aboutsummaryrefslogtreecommitdiff
path: root/dzref
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-12-27 18:35:57 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-12-27 18:35:57 -0500
commite0d8a61bdc1cc15238bc1aa30510c7ee2db4feb8 (patch)
tree9ba31b902b5fc564231e471c39ddc2b1e2f4d2e5 /dzref
parent6a1ccd4bd4b053d494cb9acfc8116550e3de8bec (diff)
Validate right operand result for rank and depth operators
Diffstat (limited to 'dzref')
-rwxr-xr-xdzref9
1 files changed, 8 insertions, 1 deletions
diff --git a/dzref b/dzref
index 2c38fd2d..28bba9d5 100755
--- a/dzref
+++ b/dzref
@@ -4,7 +4,14 @@ impl ← "
#⌜
# LAYER 4: Operators
-_ranks ← {⟨2⟩⊘⟨1,0⟩((⊣-1+|)˜⟜≠⊑¨<∘⊢)⥊∘𝔽}
+ValidateRanks←{
+ ! 1≥=𝕩
+ 𝕩↩⥊𝕩
+ ! (1⊸≤∧≤⟜3)≠𝕩
+ ! ∧´⌊⊸=⌜𝕩
+ 𝕩
+}
+_ranks ← {⟨2⟩⊘⟨1,0⟩ ((⊣-1+|)˜⟜≠⊑¨<∘⊢) ValidateRanks∘𝔽}
_depthOp_←{
neg←0>n←𝕨𝔾_ranks𝕩 ⋄ F←𝔽
_d←{