diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-03-28 21:51:08 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-03-28 21:51:08 -0400 |
| commit | b035e1ef01049add0c3301cc2fa87ae30dc4e461 (patch) | |
| tree | 28a7107d163a3328836714055377fa327595d239 /src/r1.bqn | |
| parent | 09039d1f5742535fe14768b1a1f4ca28e4a2259f (diff) | |
Fix depth-2 expansion of structure already at depth 1
Diffstat (limited to 'src/r1.bqn')
| -rw-r--r-- | src/r1.bqn | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -377,7 +377,7 @@ under←{ Expand ← { f‿a‿i‿q←𝕩 ⋄ e←i⊑⥊a - Expand2⍟(2=𝕨) ⟨IsArray◶⟨⟨⟩,∾⟜⟨i⟩⟩f,e,IsArray◶⟨0,@Fill⥊⟜(↕1×´⊢)∘≢⟩e,q⟩ + ⟨IsArray◶⟨⟨⟩,∾⟜⟨i⟩⟩f,e,IsArray◶⟨0,@Fill⥊⟜(↕1×´⊢)∘≢⟩e,q⟩ }⍟(>⟜(IsArray 2⊑⊢)) Expand2 ← { xf‿xa‿xi‿xq ← 𝕩 @@ -386,7 +386,7 @@ under←{ } _s ← { ⟨st,d‿o⟩←𝕩 # Function, input depth, output is structural - f‿a‿i‿⟨q,r⟩←d Expand 𝕗 # Path, array reference, indices, info + f‿a‿i‿⟨q,r⟩←Expand2⍟(2=d) (0<d) Expand 𝕗 # Path, array reference, indices, info {f‿a‿𝕩‿⟨q⌈1<o,r⟩ _s}⍟(1-IsStruct)⍟(0<o) 𝕨 St i } IsStruct ← (StructD←(4=0⊸⊑)◶⟨0,s˙=2⊸⊑⟩) {Decompose𝕩} |
