Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve consistency of equality between objects #279

Open
cmoesel opened this issue Oct 6, 2022 · 0 comments
Open

Improve consistency of equality between objects #279

cmoesel opened this issue Oct 6, 2022 · 0 comments

Comments

@cmoesel
Copy link
Member

cmoesel commented Oct 6, 2022

In the current implementation, equality of data types (e.g., Quantity, Date, DateTime, etc) can be determined in multiple ways:

  1. a.equals(b)
  2. b.equals(a)
  3. equals(a, b) (and perhaps also equals(b, a))

When PR #278 is merged, it will introduce another way:

  1. Immutable.is(a, b)

The results of these operations may differ depending on which one you call and which data types are passed in. This should not be the case, as all equality operations should be consistent and commutative. Ideally, they should all be backed by the same implementation.

For additional discussion, see: #278 (comment).

@cmoesel cmoesel mentioned this issue Oct 6, 2022
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant