Skip to content

Commit

Permalink
add unique(). fixes #1645
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Dec 4, 2012
1 parent 9023005 commit 6671e03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/export.jl
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ export
toggle_each,
union,
union!,
unique,
values,
valtype,
xor!,
Expand Down
2 changes: 2 additions & 0 deletions base/set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit 6671e03

Please sign in to comment.