aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-13 14:24:55 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-13 14:24:55 -0500
commit80060dfab6cc93719b27b6f8ff3f3c5138f33781 (patch)
treed15b1b5c137966718c88fe178be98fbda7bbbcab /src
parent2f1af470e07f3785ba0c98794458dc570288b615 (diff)
Allow reaching into atoms by boxing them in structural Under
Diffstat (limited to 'src')
-rw-r--r--src/r.bqn3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/r.bqn b/src/r.bqn
index a3c902f4..5a26ed4f 100644
--- a/src/r.bqn
+++ b/src/r.bqn
@@ -172,6 +172,7 @@ _under_←{
Captures←IsArray∘⊣◶⟨1, {𝕨◶0‿𝕩}´⟨IsArray⊢, =○=, 1×´=¨○≢, {1×´⥊𝕨Captures¨𝕩}⟩⟩
Set←{
Set1←𝕨⊸{
+ 𝕩↩<⍟(1-IsArray)𝕩
i←↕l←1×´s←≢𝕩
nv‿gi←((IsArray 𝕨)⊑{⟨𝕩⟩}‿⥊)¨ v‿𝕨
! 1×´Nat⌜gi
@@ -196,7 +197,7 @@ Recompose ← ⊣◶⟨
_structural←{
E←StructErr˙
- Inds ← ⥊⟜(↕1×´⊢)∘≢⍟(1-IsStructErr) 𝕩 IsArray∘⊢◶⟨E,⊑⟜⥊⟩´ Reverse
+ Inds ← IsArray◶⟨0,⥊⟜(↕1×´⊢)≢⟩ 𝕩 ⊑⟜⥊⍟(IsArray⊢)´ Reverse
_s_ ← {
f←𝕗
st‿d‿o←𝕩