Table of Contents

Distinct

C10 - initial

distinct (Sifts)
TypeCorrade progressive sift
Siftdistinct
Parametersthe empty string
DescriptionThe distinct sift will return only unique elements in a list.
Last ChangesNone

The distinct sift will return only unique elements in a list.

Arguments

Position Type Description Example
0 empty string None ""

Example

The following sift when added to a command will skip the first 2 elements, then return the distinct remaining elements and then finally count the number of remaining elements that match the regular expression [0-9]:

    "sift", wasListToCSV([
        "skip", 2,
        "distinct", "",
        "count", "[0-9]"
    ]),

Effect on Returned Data

Given the input

data=a,1,c,2,c,3,h,2,h,5,j,5

the following transformations will take place:

  1. skip, 2 $\leadsto$ data=c,2,c,3,h,2,h,5,j,5,
  2. distinct $\leadsto$ data=c,2,3,h,5,j,
  3. count, [0-9] $\leadsto$ data=6

and expected output is:

data=6

Notes