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

Iterators.countfrom(::Any, ::Any) doesn't exist #37462

Closed
MarcMush opened this issue Sep 8, 2020 · 1 comment · Fixed by #37747
Closed

Iterators.countfrom(::Any, ::Any) doesn't exist #37462

MarcMush opened this issue Sep 8, 2020 · 1 comment · Fixed by #37747

Comments

@MarcMush
Copy link
Contributor

MarcMush commented Sep 8, 2020

Is there a reason why only Iterators.countfrom(::Number, ::Number) is defined ?

I wanted to do

using Dates
Iterators.countfrom(now(), Minute(15))

I know I can do the same with Numbers but I like this syntax
It doesn't look like it would be an issue to allow it:

iterate(it::Count, state=it.start) = (state, state + it.step)

@MarcMush
Copy link
Contributor Author

MarcMush commented Sep 8, 2020

now():Minute(15):(now()+Day(1))

does work so it would make sense

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 a pull request may close this issue.

1 participant