I've written a simple immutable type and I'm a little confused by some 
behaviour I've seen:

immutable GapAnchor
  gapPos::Int 
  seqPos::Int 
end 

function Base.copy(src::GapAnchor) 
  return GapAnchor(src.gapPos, src.seqPos) 
end 

a = GapAnchor(5, 9) 

GapAnchor(5,9) 

b = copy(a) 

GapAnchor(5,9) 

a == b 

true 

a === b 

true 

is(a, b) 

true


I'm a bit confused as to why '===' would return true for a and b when it is 
supposed to check if two variables point to the same thing in memory, and 
copy constructs a new GapAnchor. 

Reply via email to