From 6671e036b8a4a96c30f021a5bf9a824b6b28d33b Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Tue, 4 Dec 2012 18:26:14 -0500 Subject: [PATCH] add unique(). fixes #1645 --- base/export.jl | 1 + base/set.jl | 2 ++ 2 files changed, 3 insertions(+) diff --git a/base/export.jl b/base/export.jl index f20ffd698f2a4..36cfb919e9224 100644 --- a/base/export.jl +++ b/base/export.jl @@ -767,6 +767,7 @@ export toggle_each, union, union!, + unique, values, valtype, xor!, diff --git a/base/set.jl b/base/set.jl index 098b3a127e847..0f793dec392bc 100644 --- a/base/set.jl +++ b/base/set.jl @@ -82,3 +82,5 @@ end -(a::Set, b::Set) = setdiff(a,b) isequal(l::Set, r::Set) = length(l) == length(r) == length(intersect(l,r)) + +unique(C) = elements(add_each(Set{eltype(C)}(), C))