diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-01-23 21:09:20 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-01-23 21:09:20 -0500 |
| commit | 46e98146bf50e12fce72474170645da8040ccf99 (patch) | |
| tree | 0ab2f708bae1cc96ba1b48bf241845c64bba9859 | |
| parent | 8924da5482d91ad21f56428ea5673560f2a265e7 (diff) | |
Add shift functions to fill spec
| -rw-r--r-- | docs/spec/inferred.html | 8 | ||||
| -rw-r--r-- | spec/inferred.md | 10 | ||||
| -rw-r--r-- | 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 @@ <tbody> <tr> <td><code><span class='Function'>⊢</span></code></td> -<td><code><span class='Function'>⥊⌽⍉⊏≍∧∨⍷</span></code></td> -<td><code><span class='Function'>⥊⌽⍉⊏↑↓↕/</span></code></td> +<td><code><span class='Function'>∧∨⥊≍»«⌽⍉⊏⍷</span></code></td> +<td><code><span class='Function'>⥊↑↓↕⌽⍉/⊏</span></code></td> <td><code><span class='Function'>𝔽</span><span class='Modifier'>`</span></code></td> </tr> <tr> <td><code><span class='Number'>0</span></code></td> <td><code><span class='Function'>≢/⍋⍒∊⊐⊒</span></code></td> -<td><code><span class='Function'>⍋⍒∊⍷⊐⊒</span></code></td> +<td><code><span class='Function'>⍋⍒⊐⊒∊⍷</span></code></td> <td></td> </tr> <tr> @@ -107,7 +107,7 @@ <tr> <td><code><span class='Value'>∩</span></code></td> <td><code><span class='Function'>>∾</span></code></td> -<td><code><span class='Function'>∾≍</span></code></td> +<td><code><span class='Function'>∾≍»«</span></code></td> <td></td> </tr> <tr> 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⥊⟨⟩⊔"" |
