Distinct: Difference between revisions

From The K Language Wiki
Content added Content deleted
(unsorted unique (k9))
m (Lowercase title)
Line 1: Line 1:
{{lowercase title}}
{{primitive|?x}}
{{primitive|?x}}

'''Distinct''', a.k.a. '''unique''' or '''uniq''', returns a copy of its argument without duplicate items (according to the definition of [[match]]). K9 additionally sorts the result.
'''distinct''', a.k.a. '''unique''' or '''uniq''', returns a copy of its argument without duplicate items (according to the definition of [[match]]). K9 additionally sorts the result.


?"abracadabra"
?"abracadabra"

Revision as of 21:30, 8 July 2022


Distinct
?x

distinct, a.k.a. unique or uniq, returns a copy of its argument without duplicate items (according to the definition of match). K9 additionally sorts the result.

 ?"abracadabra"
"abrcd"
 ?"abracadabra" /k9
"abcdr"
{x@&(x?x)=!#x}  /k9 unsorted unique