Open
Description
opened on Dec 13, 2018
Hello everyone,
allunique
doesn't seem to work on my structs. The documentation says: "allunique
: Return true if all values from itr are distinct when compared with isequal
."
import Base: isequal
mutable struct Cart
x::Int
y::Int
end
isequal(c1::Cart, c2::Cart) = return (c1.x == c2.x && c1.y == c2.y)
c1 = Cart(2, 3)
c2 = Cart(2, 3)
isequal(c1, c2) # == true
c1 ∈ [c1, c2] # == true
allunique([c1, c2]) # == true?!
Is this expected?
julia> versioninfo()
Julia Version 1.0.2
Commit d789231e99 (2018-11-08 20:11 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, ivybridge)
Environment:
JULIA_NUM_THREADS = 2
Activity