From eb01eb415a5304d98c55f844188bb0defac90c67 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 17 Jul 2020 12:04:34 -0400 Subject: Character entity escaping for "&<> --- docs/join.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs/join.html') diff --git a/docs/join.html b/docs/join.html index 881b318b..e54d2a4f 100644 --- a/docs/join.html +++ b/docs/join.html @@ -1,18 +1,18 @@

Join

-

Join () is an extension of the monadic function Raze from A+ and J to arbitrary argument ranks. It has the same relationship to Join to, the dyadic function sharing the same glyph, as Unbox (>) does to Couple (): ab is >ab and ab is ab. While Unbox and Couple combine arrays (the elements of Unbox's argument, or the arguments themselves for Coups) along a new leading axis, Join and Join to combine them along the existing leading axis. Both Unbox and Join can also be called on a higher-rank array, causing Unbox to add multiple leading axes while Join combines elements along multiple existing axes.

+

Join () is an extension of the monadic function Raze from A+ and J to arbitrary argument ranks. It has the same relationship to Join to, the dyadic function sharing the same glyph, as Unbox (>) does to Couple (): ab is >ab and ab is ab. While Unbox and Couple combine arrays (the elements of Unbox's argument, or the arguments themselves for Coups) along a new leading axis, Join and Join to combine them along the existing leading axis. Both Unbox and Join can also be called on a higher-rank array, causing Unbox to add multiple leading axes while Join combines elements along multiple existing axes.

Join can be used to combine several strings into a single string, like array.join() in Javascript (but it doesn't force the result to be a string).

-
    "time""to""join""some""words"
+
    "time""to""join""some""words"
 [ timetojoinsomewords ]
 

To join with a separator in between, we might prepend the separator to each string, then remove the leading separator after joining. Another approach would be to insert the separator array as an element between each pair of array elements before calling Join.

-
    1↓∾' '¨"time""to""join""some""words"
+
    1↓∾' '¨"time""to""join""some""words"
 [ time to join some words ]
 

Join requires each element of its argument to be an array, and their ranks to match exactly. No rank extension is performed.

-
    "abc"'d'"ef"  # Includes a non-array
+
    "abc"'d'"ef"  # Includes a non-array
 RANK ERROR
-    "abc"(<'d')"ef"  # Includes a scalar
+    "abc"(<'d')"ef"  # Includes a scalar
 RANK ERROR
 

However, Join has higher-dimensional uses as well. Given a rank-m array of rank-n arrays (requiring mn), 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.

-- cgit v1.2.3