-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
feat(stdlib): Add Array.slice function #727
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is likely to be a bit controversial for the team
Nope, you implemented exactly the semantics I'd expect from slice()
. This looks good to me! I just have some minor feedback on the documentation.
3c86962
to
9eb8922
Compare
1298bb7
to
261f688
Compare
Co-authored-by: Oscar Spencer <oscar@grain-lang.org>
Co-authored-by: Oscar Spencer <oscar@grain-lang.org>
Rebased, and I believe I got all of the comments I lost in the force push experiment. |
Co-authored-by: Oscar Spencer <oscar@grain-lang.org>
In the spirit of #711 - I've begun splitting out the changes from the "misc" section of #680
This adds
slice
to the Array stdlib. I actually rewrote the function because I believe our guiding principals on the stdlib is to be graceful where possible. This change is likely to be a bit controversial for the team so I'd like feedback if anyone doesn't think we should handle indexes too large or negative indexing from the end.