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

slice function params #71

Open
jaroslavlibal opened this issue Oct 5, 2020 · 0 comments
Open

slice function params #71

jaroslavlibal opened this issue Oct 5, 2020 · 0 comments

Comments

@jaroslavlibal
Copy link

The docs for the slice function says:

Returns a lazy collection of items which are part of the original collection from item number $from to item number $to inclusive. The items before $from are also realized, just not returned.

But its $to param usage is exclusive in the implementation:
if ($index >= $from && ($index < $to || $to == -1))

Also, naming an index (starting at zero) as the item number may be a little confusing.

Did I get something wrong, please? If this is an issue, is it a documentation or implementation one? Is it intended to be inclusive or exclusive?

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