From e67fa3aea4dff978584778ddd782f2548e7c49cc Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 10 Jul 2024 18:04:09 -0700 Subject: doc: partition, split, split*: clarifications about indices * txr.1: Clarify what repeated values mean in partition, since they are allowed. For split/split*, clarify that indice have to be strictly increasing after negative indicates are displaced by the sequence length, and that the behavior is unspecified otherwise. --- txr.1 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/txr.1 b/txr.1 index c18ee4ce..587874a9 100644 --- a/txr.1 +++ b/txr.1 @@ -37204,8 +37204,10 @@ to its value. The sequence index positions thus denoted by shall be strictly nondecreasing. Each successive element is expected to designate an index position at least as high as all previous elements, otherwise the behavior is unspecified. -Leading index positions which are (still) negative, or zero, are effectively -ignored. +Index values which are still negative after the addition of the +sequence length are ignored, as are index values greater than +the sequence length. Nondecreasing means that repeated values +are permitted; they have the same effect as a single value. If .meta index-seq @@ -37310,6 +37312,14 @@ as the corresponding arguments of the function, with the following difference: the index positions indicated by .code index-seq are required to be strictly increasing, rather than nondecreasing. +As with +.codn partition , +this consideration applies to the transformed indices, after the +displacement of negative values by the length of the sequence. +If any element of +.meta index-seq +is not higher than the previous element, the behavior is unspecified. + If the second argument is of the form .metn index-seq , -- cgit v1.2.3