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

Improve Range usability #109

Closed
mfelsche opened this issue Nov 22, 2017 · 2 comments
Closed

Improve Range usability #109

mfelsche opened this issue Nov 22, 2017 · 2 comments

Comments

@mfelsche
Copy link
Contributor

Current issues with collections.Range that hurt its usability:

  • negative Ranges (where min > max) is only expressable for signed integers:

    // this is not possible, as the inc parameter is also U8
    Range[U8](10, 0, -1)
  • The default inc should only be 1 if min <= max, otherwise it should be -1 to ensure that we iterate into the expected direction:

     // this should infer a default step of -1
    Range[U8](10, 0)
    
    // this should infer a default step of 1
    Range[U64](0, 10)
@EpicEric
Copy link

Solved by ponylang/ponyc#2350

@SeanTAllen
Copy link
Member

Thanks @EpicEric!

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

3 participants