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

Suggestion: add "irange", "icount" which would return ints instead of nums #687

Open
noamraph opened this issue Sep 26, 2021 · 2 comments
Open

Comments

@noamraph
Copy link

Hi,

I just used range to find the first index which satisfies some condition relating to the next member of the list.
I had to use .toInt() twice, to convert the num instances to ints.

How about adding an "irange" and "icount" functions, which would do the same thing but with ints?

If I send a pull request with that, will it be considered?

Thanks,
Noam

@cbracken
Copy link
Member

Since only the types would differ, I think the right approach would probably to make range generic. That would allow for either approach. That would rely on implicit type deduction for backward compatibility, so we'd want to test on the internal codebase, but that seems reasonable to me.

@michaellee8
Copy link

@cbracken Are there any plan to provide this in the public version?

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