From 46e98146bf50e12fce72474170645da8040ccf99 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 23 Jan 2021 21:09:20 -0500 Subject: Add shift functions to fill spec --- docs/spec/inferred.html | 8 ++++---- spec/inferred.md | 10 +++++----- test/cases/fill.bqn | 4 ++++ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/spec/inferred.html b/docs/spec/inferred.html index e587655a..ba10d696 100644 --- a/docs/spec/inferred.html +++ b/docs/spec/inferred.html @@ -88,14 +88,14 @@ -⥊⌽⍉⊏≍∧∨⍷ -⥊⌽⍉⊏↑↓↕/ +∧∨⥊≍»«⌽⍉⊏⍷ +⥊↑↓↕⌽⍉/⊏ 𝔽` 0 ≢/⍋⍒∊⊐⊒ -⍋⍒∊⍷⊐⊒ +⍋⍒⊐⊒∊⍷ @@ -107,7 +107,7 @@ >∾ -∾≍ +∾≍»« diff --git a/spec/inferred.md b/spec/inferred.md index 77d83b62..43d92e8a 100644 --- a/spec/inferred.md +++ b/spec/inferred.md @@ -46,12 +46,12 @@ Arithmetic primitives—all valences of `+-×÷⋆√⌊⌈|¬` and dyadic `∧ Fill elements for many primitives are given in the table below. The "Fill" column indicates the strategy used to compute the result's fill. Fields `0`, `𝕩`, `0↑𝕩`, and `0⚇0𝕩` indicate the fill directly, while `⊢` and `∩` indicate that the fill is to be computed from the argument fills (if not all arguments have fills, then the fill element is unspecified). For `⊢`, the fill element of the result is the fill element of `𝕩`. For `∩`, the fill is equal to the fill values for multiple arrays, provided that they are all equal (it's unspecified if they are not all equal). In the two argument case, these arrays are `𝕨` and `𝕩`. In the one-argument case, they are the elements of `𝕩`; however, if `𝕩` is empty, then the result's fill is the fill of the fill of `𝕩`. -| Fill | Monads | Dyads | Modifiers -|--------|------------|-------------|---------- -| `⊢` | `⥊⌽⍉⊏≍∧∨⍷` | `⥊⌽⍉⊏↑↓↕/` | `` 𝔽` `` -| `0` | `≢/⍋⍒∊⊐⊒` | `⍋⍒∊⍷⊐⊒` +| Fill | Monads | Dyads | Modifiers +|--------|--------------|-------------|---------- +| `⊢` | `∧∨⥊≍»«⌽⍉⊏⍷` | `⥊↑↓↕⌽⍉/⊏` | `` 𝔽` `` +| `0` | `≢/⍋⍒∊⊐⊒` | `⍋⍒⊐⊒∊⍷` | `𝕩` | `<` -| `∩` | `>∾` | `∾≍` +| `∩` | `>∾` | `∾≍»«` | `0↑𝕩` | `↑↓` | `0⚇0𝕩` | `↕` diff --git a/test/cases/fill.bqn b/test/cases/fill.bqn index ef9e86c3..bf42ee7a 100644 --- a/test/cases/fill.bqn +++ b/test/cases/fill.bqn @@ -39,6 +39,8 @@ " cba" ≡ ¯4↑⌽"abc" "bca " ≡ 4↑1⌽"abc" ≡○»⟜(⊏≍) ⥊<"ab"‿∞ +" bc" ≡ »«"abc" +" "‿0 ≡ ⊑0⥊»4⥊<"str"‿∞ "c " ≡ 3↑⍉'c' (≍" ") ≡ »⍉⌊‿1⥊"wxy" " "≡1↑»3/"ab" @@ -62,6 +64,8 @@ (' '¨⊸≍"abc") ≡ »"abc"≍"def" ≡○(⊑0⊸⥊)⟜(∾↑) 0‿'a'‿2 + <⟨0,1‿2⟩ 0‿0 ≡ ⊑0⊸⥊ 1‿3∾○↕2‿3 +" ax" ≡ »"a"»"xyz" +0‿0 ≡ ⊑0⊸⥊ 5‿4<⊸«⥊↕2‿2 # Group "" ≡ ⊑0⥊⟨⟩⊔"" -- cgit v1.2.3