aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-11 22:06:22 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-11 22:06:22 -0500
commitfd5007d0e5ff97acfddc6d60425f567b8d95dbe5 (patch)
tree9102fb29e674a926c9e5c77cf2d3672bba27d898 /src
parent4df717aa072f1550fa4740c5413b551428b1119c (diff)
Create expandable index for structural Under
Diffstat (limited to 'src')
-rw-r--r--src/r.bqn12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/r.bqn b/src/r.bqn
index 5fd2e620..b9d716ef 100644
--- a/src/r.bqn
+++ b/src/r.bqn
@@ -714,5 +714,15 @@ Inverse ← Type◶(3‿1‿2/{⊢⊣𝕩IX∘≡⊢}‿FuncInverse‿("Cannot i
⁼ ↩ {𝕗 (≢∧INF˙⊸≢)◶0‿(5‿_inv_≢0‿¯2⊏Decompose∘⊢)◶⊢‿{𝕏_inv_(𝕎_invChk_𝕏)} Inverse 𝕗}
_structural←{
- ⟨⟩‿(𝔽⥊⟜(↕1×´⊢)≢𝕩)
+ Inds ← ⥊⟜(↕1×´⊢)∘≢ 𝕩⊑⟜⥊´⌽
+ _s_ ← {
+ f←𝕗
+ st‿d‿o←𝕩
+ g←𝕨 St Inds∘{f↩f(¯1≢⊣)◶⟨⟩‿∾𝕩}⍟(d>IsArray) 𝕘
+ {f _s_ 𝕩}⍟o g
+ }
+ IsStruct ← 5‿s ≡ 0‿¯2⊏Decompose
+ _sfn ← {(IsStruct⊢)◶⟨𝕏, 𝕩‿𝕨‿𝕗{𝕨𝕏𝕗}⟩}
+ Depth←1 _sfn ⋄ Info←0 _sfn
+ 1‿3 ⊏ Decompose {𝕎𝕩}´ ⟨1 Depth 𝕗, ¯1 _s_ 0⟩
}