From cf4d42fc8ea7875a7df2e85688d1466ebbbbc36b Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Mon, 28 Mar 2022 17:07:31 -0400 Subject: =?UTF-8?q?Support=20for=20=E2=88=BE=20and=20>=20in=20Under?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/r1.bqn | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'src/r1.bqn') diff --git a/src/r1.bqn b/src/r1.bqn index f694b2fc..e34d28ba 100644 --- a/src/r1.bqn +++ b/src/r1.bqn @@ -377,12 +377,17 @@ under←{ Expand ← { f‿a‿i‿q←𝕩 ⋄ e←i⊑⥊a - ⟨IsArray◶⟨⟨⟩,∾⟜⟨i⟩⟩f,e,IsArray◶⟨0,@Fill⥊⟜(↕1×´⊢)∘≢⟩e,q⟩ + Expand2⍟(2=𝕨) ⟨IsArray◶⟨⟨⟩,∾⟜⟨i⟩⟩f,e,IsArray◶⟨0,@Fill⥊⟜(↕1×´⊢)∘≢⟩e,q⟩ + }⍟(>⟜(IsArray 2⊑⊢)) + Expand2 ← { + xf‿xa‿xi‿xq ← 𝕩 + i ← { f‿a‿i‿q←1 Expand xf‿xa‿𝕩‿xq ⋄ {f‿a‿𝕩‿q _s}⍟(1-IsStruct)⌜i }⌜ xi + ⟨⟩‿@‿i‿⟨1,1⟩ } _s ← { ⟨st,d‿o⟩←𝕩 # Function, input depth, output is structural - f‿a‿i‿⟨q,r⟩←Expand⍟(d>·IsArray 2⊑⊢)𝕗 # Path, array reference, indices, info - {f‿a‿𝕩‿⟨q⌈1", 2‿1 _mon - # "∾", 2‿1 _mon # Dyad combines + ">", 2‿1 _mon + "∾", 2‿1 {+○IsStruct◶⟨𝕏, 𝕩‿𝕗{𝕨𝕏𝕗}⊘E, 𝕏_nested⟩} # "˘⎉¨⌜", # "⚇", ⟩ @@ -472,7 +486,6 @@ under←{ _indRec ← { root‿x←𝕗 ⋄ iv←𝕩 - "TODO"!0=≠root l ← GroupLen i ← (1=Type)◶⟨0⊑0⊑1⊑Decompose,¯1⟩⌜ 0⊑iv ind‿val ← (l GroupOrd i)⊸⊏⌜ iv ⋄ rec←0 ic ← (1<·≠0⊑⊢)◶⟨2⊑⊢,{rec↩1⋄𝕩_s}(⋈1↓0⊑⊢)∾1↓⊢⟩∘(1⊑Decompose)⌜ ind -- cgit v1.2.3