Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

== defined by @auto_hash_equals calls isequal instead of == #35

Closed
matthias314 opened this issue Aug 12, 2023 · 3 comments
Closed

== defined by @auto_hash_equals calls isequal instead of == #35

matthias314 opened this issue Aug 12, 2023 · 3 comments

Comments

@matthias314
Copy link

matthias314 commented Aug 12, 2023

Wouldn't it be more consistent if == applied == to all fields? There could be a separate definition for isequal that applies isequal to all fields.

@ORBAT
Copy link

ORBAT commented Aug 17, 2023

I'd see defaulting to isequal as a good choice since it'll give you correct results even for the cases where == gives silly results, and I'm under the impression that it's what you should be using for equality comparisons of fields anyhow. That it's inconsistent is in my opinion a bit inconsequential: I'd rather take a == that returns sensible results by default rather than having one that uses == for comparisons, and then having to have a separate isequal method that I'll have to remember to use for my types because == can't be trusted.

@gafter
Copy link
Member

gafter commented Aug 18, 2023

Since this repo has been ported to https://github.com/JuliaServices/AutoHashEquals.jl, this is a dup of JuliaServices/AutoHashEquals.jl#18

@gafter gafter closed this as completed Aug 18, 2023
@gafter
Copy link
Member

gafter commented Aug 18, 2023

@ORBAT You're welcome to comment on JuliaServices/AutoHashEquals.jl#18 if you're interested in this topic. All of this code has moved to https://github.com/JuliaServices/AutoHashEquals.jl (it will become version 1.0 soon) and this repo will be archived.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants