aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-03-28 21:51:08 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-03-28 21:51:08 -0400
commitb035e1ef01049add0c3301cc2fa87ae30dc4e461 (patch)
tree28a7107d163a3328836714055377fa327595d239 /src
parent09039d1f5742535fe14768b1a1f4ca28e4a2259f (diff)
Fix depth-2 expansion of structure already at depth 1
Diffstat (limited to 'src')
-rw-r--r--src/r1.bqn4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/r1.bqn b/src/r1.bqn
index e34d28ba..98df23e9 100644
--- a/src/r1.bqn
+++ b/src/r1.bqn
@@ -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𝕩}