From abe8ae4745bb2ebe3b71b047aa92e2ae89a414d5 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 6 Jan 2021 21:55:23 -0500 Subject: Avoid joining units in some documentation --- doc/block.md | 2 +- doc/functional.md | 2 +- doc/group.md | 4 ++-- doc/join.md | 2 +- docs/doc/block.html | 4 ++-- docs/doc/functional.html | 2 +- docs/doc/group.html | 8 ++++---- docs/doc/join.html | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/block.md b/doc/block.md index e565ab17..690f8a27 100644 --- a/doc/block.md +++ b/doc/block.md @@ -39,7 +39,7 @@ Of these, `𝕣` is sort of a "more special" character, as we'll discuss below. The names `𝕨` and `𝕩`, and their uppercase spellings, represent function arguments. As the argument to a function is typically data, it's more common to use the lowercase forms for these. Either of these names will turn an immediate block into a function (or an immediate modifier into a deferred one; see the next section). Instead of being evaluated as soon as it appears in the source, a function is evaluated when it's called, with the special names set to appropriate values. Unlike in Dyalog APL's dfns, their values can be changed like ordinary variables. {'c'=𝕩} "abcd" - { 𝕩+↩2 β‹„ 0βˆΎπ•© } 3 + { 𝕩+↩2 β‹„ 0≍𝕩 } 3 4 { βŸ¨π•©β‹„-π•¨βŸ© } 5 A function with `𝕨` in its definition doesn't have to be called with two arguments. If it has only one, then `𝕨` is given the special value Nothing `Β·`. This is the only time a variable can ever be Nothing, as an assignment such as `v←·` is not allowed. diff --git a/doc/functional.md b/doc/functional.md index 49fb0c25..86621699 100644 --- a/doc/functional.md +++ b/doc/functional.md @@ -151,7 +151,7 @@ Like any function, this one can be given a name and then called. A quirk of this Another, and probably more common, use of arrays of functions is to apply several different functions to one or more arguments. Here we apply three different functions to the number 9: - ⟨√, 2⊸∾, ⊒-β‹†βŸ© {π•Žπ•©}Β¨ 9 + ⟨√, 2βŠΈβ‰, ⊒-β‹†βŸ© {π•Žπ•©}Β¨ 9 The 2-modifier Choose (`β—Ά`) relies on arrays of functions to… function. It's very closely related to Pick `βŠ‘`, and in fact when the left operand and the elements of the right operand are all data there's no real difference: Choose returns the constant function `π•—βŠ‘π•˜`. diff --git a/doc/group.md b/doc/group.md index 592b868d..4bd82dc2 100644 --- a/doc/group.md +++ b/doc/group.md @@ -72,12 +72,12 @@ The obvious application of Group is to group some values according to a known or If we would like a particular index to key correspondence, we can use a fixed left argument to Index Of. countries ← "IT"β€Ώ"JP"β€Ώ"NO"β€Ώ"SU"β€Ώ"US" - countries ∾˘ co countriesβŠΈβŠβŠΈβŠ” ln + countries β‰Λ˜ co countriesβŠΈβŠβŠΈβŠ” ln However, this solution will fail if there are trailing keys with no values. To force the result to have a particular length you can append that length as a dummy index to each argument, then remove the last group after grouping. countries ↩ "IT"β€Ώ"JP"β€Ώ"NO"β€Ώ"SU"β€Ώ"US"β€Ώ"ZW" - countries ∾˘ co countries{π•—βŠΈβŠβŠΈ(Β―1β†“βŠ”β—‹(∾⟜(≠𝕗)))} ln + countries β‰Λ˜ co countries{π•—βŠΈβŠβŠΈ(Β―1β†“βŠ”β—‹(∾⟜(≠𝕗)))} ln ### Partitioning diff --git a/doc/join.md b/doc/join.md index 7a0523dd..50a817e7 100644 --- a/doc/join.md +++ b/doc/join.md @@ -49,7 +49,7 @@ Join requires each element of its argument to be an array, and their ranks to ma However, Join has higher-dimensional uses as well. Given a rank-`m` array of rank-`n` arrays (requiring `m≀n`), it will merge arrays along their first `m` axes. For example, if the argument is a matrix of matrices representing a [block matrix](https://en.wikipedia.org/wiki/Block_matrix), Join will give the corresponding unblocked matrix as its result. - ⊒ m ← (3β€Ώ1∾⌜4β€Ώ2β€Ώ5) β₯ŠΒ¨ 2β€Ώ3β₯Šβ†•6 + ⊒ m ← (3β€Ώ1β‰βŒœ4β€Ώ2β€Ώ5) β₯ŠΒ¨ 2β€Ώ3β₯Šβ†•6 ∾ m # Join all that together Join has fairly strict requirements on the shapes of its argument elementsβ€”although less strict than those of Merge, which requires they all have identical shape. Suppose the argument to Join has rank `m`. Each of its elements must have the same rank, `n`, which is at least `m`. The trailing shapes `mβ†“βŸœβ‰’Β¨π•©` must all be identical (the trailing shape `mβ†“β‰’βˆΎπ•©` of the result will match these shapes as well). The other entries in the leading shapes need not be the same, but the shape of an element along a particular axis must depend only on the location of the element along that axis in the full array. For a list argument this imposes no restriction, since the one leading shape element is allowed to depend on position along the only axis. But for higher ranks the structure quickly becomes more rigid. diff --git a/docs/doc/block.html b/docs/doc/block.html index 1fcd1dd6..e5652775 100644 --- a/docs/doc/block.html +++ b/docs/doc/block.html @@ -68,9 +68,9 @@

Of these, 𝕣 is sort of a "more special" character, as we'll discuss below. Except for 𝕣, every special name is a single character and can't have underscores added to spell it as a modifier, allowing a modifier to be applied to a special name with no spacing as in 𝕗_m, something that can't be done with ordinary names.

Arguments

The names 𝕨 and 𝕩, and their uppercase spellings, represent function arguments. As the argument to a function is typically data, it's more common to use the lowercase forms for these. Either of these names will turn an immediate block into a function (or an immediate modifier into a deferred one; see the next section). Instead of being evaluated as soon as it appears in the source, a function is evaluated when it's called, with the special names set to appropriate values. Unlike in Dyalog APL's dfns, their values can be changed like ordinary variables.

-↗️
    {'c'=𝕩} "abcd"
+↗️
    {'c'=𝕩} "abcd"
 ⟨ 0 0 1 0 ⟩
-    { 𝕩+↩2 β‹„ 0βˆΎπ•© } 3
+    { 𝕩+↩2 β‹„ 0≍𝕩 } 3
 ⟨ 0 5 ⟩
     4 { βŸ¨π•©β‹„-π•¨βŸ© } 5
 ⟨ 5 ¯4 ⟩
diff --git a/docs/doc/functional.html b/docs/doc/functional.html
index fbba17dd..6cf2a402 100644
--- a/docs/doc/functional.html
+++ b/docs/doc/functional.html
@@ -116,7 +116,7 @@
 0.01831563888873418
 

Another, and probably more common, use of arrays of functions is to apply several different functions to one or more arguments. Here we apply three different functions to the number 9:

-↗️
    ⟨√, 2⊸∾, ⊒-β‹†βŸ© {π•Žπ•©}Β¨ 9
+↗️
    ⟨√, 2βŠΈβ‰, ⊒-β‹†βŸ© {π•Žπ•©}Β¨ 9
 ⟨ 3 ⟨ 2 9 ⟩ ¯8094.083927575384 ⟩
 

The 2-modifier Choose (β—Ά) relies on arrays of functions to… function. It's very closely related to Pick βŠ‘, and in fact when the left operand and the elements of the right operand are all data there's no real difference: Choose returns the constant function π•—βŠ‘π•˜.

diff --git a/docs/doc/group.html b/docs/doc/group.html index 2240a89c..491fca81 100644 --- a/docs/doc/group.html +++ b/docs/doc/group.html @@ -101,8 +101,8 @@ β”˜

If we would like a particular index to key correspondence, we can use a fixed left argument to Index Of.

-↗️
    countries ← "IT"β€Ώ"JP"β€Ώ"NO"β€Ώ"SU"β€Ώ"US"
-    countries ∾˘ co countriesβŠΈβŠβŠΈβŠ” ln
+↗️
    countries ← "IT"β€Ώ"JP"β€Ώ"NO"β€Ώ"SU"β€Ώ"US"
+    countries β‰Λ˜ co countriesβŠΈβŠβŠΈβŠ” ln
 β”Œβ”€                                 
 β•΅ "IT" ⟨⟩                          
   "JP" ⟨⟩                          
@@ -112,8 +112,8 @@
                                   β”˜
 

However, this solution will fail if there are trailing keys with no values. To force the result to have a particular length you can append that length as a dummy index to each argument, then remove the last group after grouping.

-↗️
    countries ↩ "IT"β€Ώ"JP"β€Ώ"NO"β€Ώ"SU"β€Ώ"US"β€Ώ"ZW"
-    countries ∾˘ co countries{π•—βŠΈβŠβŠΈ(Β―1β†“βŠ”β—‹(∾⟜(≠𝕗)))} ln
+↗️
    countries ↩ "IT"β€Ώ"JP"β€Ώ"NO"β€Ώ"SU"β€Ώ"US"β€Ώ"ZW"
+    countries β‰Λ˜ co countries{π•—βŠΈβŠβŠΈ(Β―1β†“βŠ”β—‹(∾⟜(≠𝕗)))} ln
 β”Œβ”€                                 
 β•΅ "IT" ⟨⟩                          
   "JP" ⟨⟩                          
diff --git a/docs/doc/join.html b/docs/doc/join.html
index 62f478ee..d9cac584 100644
--- a/docs/doc/join.html
+++ b/docs/doc/join.html
@@ -67,7 +67,7 @@ ERROR
 ERROR
 

However, Join has higher-dimensional uses as well. Given a rank-m array of rank-n arrays (requiring m≀n), it will merge arrays along their first m axes. For example, if the argument is a matrix of matrices representing a block matrix, Join will give the corresponding unblocked matrix as its result.

-↗️
    ⊒ m ← (3β€Ώ1∾⌜4β€Ώ2β€Ώ5) β₯ŠΒ¨ 2β€Ώ3β₯Šβ†•6
+↗️
    ⊒ m ← (3β€Ώ1β‰βŒœ4β€Ώ2β€Ώ5) β₯ŠΒ¨ 2β€Ώ3β₯Šβ†•6
 β”Œβ”€                                   
 β•΅ β”Œβ”€          β”Œβ”€      β”Œβ”€             
   β•΅ 0 0 0 0   β•΅ 1 1   β•΅ 2 2 2 2 2    
-- 
cgit v1.2.3