diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-06-06 21:29:06 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-06-06 21:29:06 -0400 |
| commit | 8342ba5e9392811dbc0514a97e847a44a5b330a2 (patch) | |
| tree | f606422844d6a5df93b5bdd799b9daf4634b3145 /doc/replicate.md | |
| parent | 272464e78e1f44bca037868ce83092856f42995e (diff) | |
When I wrote all these docs did I really understand I'd have to edit them?
Diffstat (limited to 'doc/replicate.md')
| -rw-r--r-- | doc/replicate.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/replicate.md b/doc/replicate.md index 66905116..47ae1eea 100644 --- a/doc/replicate.md +++ b/doc/replicate.md @@ -43,7 +43,7 @@ BQN doesn't have any of the various features used in APL to add fills to the res ## Replicate -Given a list of natural numbers `π¨`, Replicate repeats each major cell in `π©` the corresponding number of times. That is, `π¨` and `π©` must have the same length, and the result includes `iβπ¨` copies of each cell `iβπ©`, in order. +Given a list of natural numbers `π¨`, Replicate repeats each [major cell](array.md#cells) in `π©` the corresponding number of times. That is, `π¨` and `π©` must have the same length, and the result includes `iβπ¨` copies of each cell `iβπ©`, in order. 2βΏ1βΏ0βΏ2 / "abcd" @@ -65,7 +65,7 @@ When `π¨` is a list of booleans, a cell is never repeated more than once, mean Here `β€β'i'` is a pervasive function, so there's no need to add `Β¨`. Similarly, to filter major cells of an array, `FnΛβΈ/` could be used, applying `Fn` to one major cell at a time. -A similar pattern applies to Replicate as well. The function below tests which input characters are double quotes, but by adding one it changes the result to 1 for each non-quote character and 2 for quotes (but source code and display also double quotes here, so the input string has only two `"`s and the output has four). +This idea extends to Replicate as well. The function below tests which input characters are double quotes, but by adding one it changes the result to 1 for each non-quote character and 2 for quotes (but source code and display also double quotes here, so the input string has only two `"`s and the output has four). {1+'"'=π©}βΈ/ "for ""escaping"" quotes" @@ -95,7 +95,7 @@ If `π¨` is `β¨β©`, then it has depth 1, but is handled with the multidimensi ## Indices -The monadic form of `/` is much simpler than the dyadic one, with no multidimensional case or mismatched argument ranks. `π©` must be a list of natural numbers, and `/π©` is the list `π©/ββ π©`. Its elements are the [indices](indices.md) for `π©`, with index `i` repeated `iβπ©` times. +The monadic form of `/` is much simpler than the dyadic one, with no multidimensional case or mismatched argument ranks. `π©` has to be a list of natural numbers, and `/π©` is the list `π©/ββ π©`. Its elements are the [indices](indices.md) for `π©`, with index `i` repeated `iβπ©` times. / 3βΏ0βΏ1βΏ2 @@ -125,7 +125,7 @@ So now we have the indices of each transition from 0 to 1 or 1 to 0, in an exten -Λ`Λ ββΏ2β₯/ 0(βΎβ βΎΛ) 0βΏ1βΏ1βΏ1βΏ0βΏ0βΏ1βΏ0βΏ1βΏ1βΏ0 -This means the transitions can be grouped exactly in pairs, the beginning and end of each group. Reshape with a [computed length](reshape.md#computed-lengths) `ββΏ2` groups these pairs, and then a scan ``-Λ`Λ`` can be used to convert the start/end format to start/length if wanted. +This means the transitions can be grouped exactly in pairs, the beginning and end of each group. Reshape with a [computed length](reshape.md#computed-lengths) `ββΏ2` groups these pairs, and then a [scan](scan.md) ``-Λ`Λ`` can be used to convert the start/end format to start/length if wanted. ### Inverse |
