From 5a5da7bc299bee12072e421d1936554690e34dd6 Mon Sep 17 00:00:00 2001 From: tslil Date: Mon, 9 Mar 2026 22:25:44 +0000 Subject: clarify top-level semantics --- .../src/selection_functions/function_empty.rs | 2 +- rprt.md | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/rprt-engine/src/selection_functions/function_empty.rs b/rprt-engine/src/selection_functions/function_empty.rs index 8290de3..a817dcf 100644 --- a/rprt-engine/src/selection_functions/function_empty.rs +++ b/rprt-engine/src/selection_functions/function_empty.rs @@ -5,6 +5,6 @@ pub fn empty_sequential(_: SFArguments) -> SFResult { Ok(Selection::empty()) } -pub fn empy_structural(_: SFArguments) -> SFResult { +pub fn empty_structural(_: SFArguments) -> SFResult { Ok(Selection::empty()) } diff --git a/rprt.md b/rprt.md index ee1299f..12449ca 100644 --- a/rprt.md +++ b/rprt.md @@ -75,10 +75,12 @@ The buffer axis (rank 3) is the **leading axis**: operations on rank 3 selection A **train** is a sequence of functions that compose according to specific rules, following [APL train syntax](https://aplwiki.com/wiki/Train). **2-train (Atop)** `F G`: +- Niladic: `(F G) = F (G)` - Monadic: `(F G) ω = F (G ω)` - Dyadic: `α (F G) ω = F (α G ω)` **3-train (Fork)** `F G H`: +- Niladic: `(F G H) = (F) G (H)` - Monadic: `(F G H) ω = (F ω) G (H ω)` - Dyadic: `α (F G H) ω = (α F ω) G (α H ω)` @@ -91,10 +93,12 @@ A **train** is a sequence of functions that compose according to specific rules, RPRT provides two explicit hook combinators from BQN for flexible function composition: **Before (Left Hook)** `F>G`: +- Niladic: `(F>G) = (F) G` - Monadic: `(F>G) ω = (F ω) G ω` - Dyadic: `α (F>G) ω = (F α) G ω` **After (Right Hook)** `F/re/` +In the niladic form this is `(.) /re/` (left hook semantics, §1.2), and `.` niladically is the current selection (§3.1). Thus `.>/re/` applies `/re/` to the current selection. + +The After hook `F