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

equals extension for deep equality of iterables #52

Open
machinescream opened this issue Jan 30, 2020 · 7 comments
Open

equals extension for deep equality of iterables #52

machinescream opened this issue Jan 30, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@machinescream
Copy link

Please add equals extensions based on ListEquality and so on...

@simc
Copy link
Owner

simc commented Jan 30, 2020

It is not possible to create an extension named equals because every object already has a method with that name. There already exists the .contentEquals() extension for iterables (and lists).

@passsy
Copy link
Collaborator

passsy commented Jan 30, 2020

I like the idea but I'm unsure if we should use ListEquality or DeepCollectionEquality. Please describe your use case and we can see which API fits best.

Alternatively you could use collections which support equality by default: BuildList or KtList

@machinescream
Copy link
Author

You probably mean == operator, I didn't see a equals in Iterable, List, etc. .contentEquals() is ok.

@simc
Copy link
Owner

simc commented Jan 30, 2020

You probably mean == operator

Yes, my bad. Is the contentEquals() method not suggested for auto-completion if you type "equals"?

@machinescream
Copy link
Author

To be honest I am against about to use different collections. I prefer use core lib with extensions =)

@simc
Copy link
Owner

simc commented Jan 30, 2020

Does contentEquals() solve your problem or do you need more options / deep collection equality?

@machinescream
Copy link
Author

Well, contentEquals solved my problem, but I think will be nice to have deep collection equality as well.

@simc simc added the enhancement New feature or request label Jan 30, 2020
@simc simc changed the title Equals extensions equals extension for deep equality of iterables Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants