apl: ⍸ where — monadic indices-of-truthy + dyadic interval-index
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 51s

- apl-where (monadic): ravel scan, filter non-zero, +⎕IO offsets
- apl-interval-index (dyadic): count of breaks ≤ y; broadcasts over
  scalar or vector Y
- Wired into apl-monadic-fn / apl-dyadic-fn cond chains
- +10 pipeline tests covering both arities, ⎕IO offsetting, edge cases
  (empty mask, all-truthy, y below/above all breaks)
- pipeline 109/109
This commit is contained in:
2026-05-08 22:35:35 +00:00
parent 58c6ec27f3
commit 8cdebbe305
4 changed files with 71 additions and 1 deletions

View File

@@ -46,6 +46,7 @@
((= g "⍕") apl-quad-fmt)
((= g "⎕FMT") apl-quad-fmt)
((= g "⎕←") apl-quad-print)
((= g "⍸") apl-where)
(else (error "no monadic fn for glyph")))))
(define
@@ -90,6 +91,7 @@
((= g "⍉") apl-transpose-dyadic)
((= g "⊢") (fn (a b) b))
((= g "⊣") (fn (a b) a))
((= g "⍸") apl-interval-index)
(else (error "no dyadic fn for glyph")))))
(define