Login  Register

ZnUrl>>#= - Why Require Same Classes?

Posted by Sean P. DeNigris on Mar 23, 2016; 2:37pm
URL: https://forum.world.st/ZnUrl-Why-Require-Same-Classes-tp4886102.html

= anObject
        ^ self class == anObject class
        ...

Most of the time, I've seen a test for #species, not class. This matters because I have a custom ZnUrl subclass that I'd like to be equal to a ZnUrl pointing to the same place.

While we're on the subject, I'm not an expert on hashing, but isn't it a problem that ZnUrl>>#hash refers to #segment, which is not immutable?
Cheers,
Sean