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

feat(stdlib): Add Array.slice function #727

Merged
merged 5 commits into from
Jun 15, 2021
Merged

feat(stdlib): Add Array.slice function #727

merged 5 commits into from
Jun 15, 2021

Conversation

phated
Copy link
Member

@phated phated commented Jun 10, 2021

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.

@phated phated requested a review from a team June 10, 2021 22:09
Copy link
Member

@peblair peblair left a 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.

@phated phated force-pushed the stdlib/array-slice branch from 3c86962 to 9eb8922 Compare June 13, 2021 17:22
@phated phated force-pushed the stdlib/array-slice branch from 1298bb7 to 261f688 Compare June 13, 2021 17:42
phated and others added 2 commits June 13, 2021 10:43
Co-authored-by: Oscar Spencer <oscar@grain-lang.org>
Co-authored-by: Oscar Spencer <oscar@grain-lang.org>
@phated
Copy link
Member Author

phated commented Jun 13, 2021

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>
@peblair peblair merged commit 66319ca into main Jun 15, 2021
@peblair peblair deleted the stdlib/array-slice branch June 15, 2021 11:28
@github-actions github-actions bot mentioned this pull request May 31, 2022
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

Successfully merging this pull request may close these issues.

4 participants