Skip to content

Add some extension methods #600

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

Closed
natebosch opened this issue Mar 6, 2020 · 3 comments
Closed

Add some extension methods #600

natebosch opened this issue Mar 6, 2020 · 3 comments

Comments

@natebosch
Copy link
Member

natebosch commented Mar 6, 2020

This is technically breaking since it introduced the possibility for name conflicts, so we may as well consider them when we'll have a major version bump.

Some methods to consider (edit this comment to add more, we don't need to add them all):

All existing top level methods should probably be moved to be extensions.

@lrhn
Copy link
Member

lrhn commented Apr 17, 2020

I would really prefer to introduce a sublist functionality where you get a new fixed-length list backed by a slice of another list, then sortRange(range) and shuffleRange(range) would just be sublist(range).sort() and sublist(range).shuffle().
It's annoying to require every operation on lists to have to/from parameters.
(Ditto for strings, I'd love a lazy substring).

The rest are perfectly reasonable extension method suggestions.

@natebosch
Copy link
Member Author

We can't use the name sublist, but we could use slice or range. I do like that idea over sortRange and shuffleRange.

@lrhn
Copy link
Member

lrhn commented Oct 19, 2020

Extensions have landed

@lrhn lrhn closed this as completed Oct 19, 2020
@mosuem mosuem transferred this issue from dart-archive/collection Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants