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

Add a method for subvector retrieval in im::Vector following the example of subvec (https://clojuredocs.org/clojure.core/subvec) from Clojure #209

Open
svblsvljb opened this issue Jun 12, 2023 · 0 comments

Comments

@svblsvljb
Copy link

Currently, there is no way to retrieve a subvector of a Vector by specifying a range. While vector.clone().slice(/* ... */) provides similar functionality, it does not panic on out-of-bounds indices and do unnecessary (for our use case) append operation (https://docs.rs/im/latest/src/im/vector/mod.rs.html#1345).

I suggest adding a separate method to the Vector implementation that allows users to specify a range and returns a new Vector with the elements in the specified range.

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