Array.nub3kaya
Remove repeated elements from a list.
Usage
Void nub( var [a] xs, Bool(a, a) eq=equal )
Arguments
xs The list
eq Optionally, the equality test. Defaults to Builtins.equal (3kaya)
Overview
Remove repeated elements from a list in-place. Repeated elements will be removed whether adjacent or not.
-
xs = [1,2,3,3,1,2,4,5,2,2,1];
nub(xs);
// xs = [1,2,3,4,5]
The name 'nub', incidentally, is borrowed from the Haskell prelude function of the same name, and suggests 'essence'.
Releases
4 releases since Debian 5.0 (Lenny); the text changed 3 times.