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

Fix Issue 15720 - iota(long.max, long.min, step) does not work properly #5396

Closed
wants to merge 0 commits into from

Conversation

andralex
Copy link
Member

Forgot conversion to unsigned in length. I suppose there are a couple more bugs in extreme cases.

iota(0, 5).map!(i => format("%s ", i)).copy(stdout.lockingTextWriter());
writeln();
}
---
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also took the opportunity to unindent the doc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the point, as Phobos uses tons of different doc styles all over the place.

Honestly I really, really don't want this to become a topic of conversation in the community. Can you drop this from the PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original doc style (and the prevalent style in this particular file) has the doc flush with the symbol being documented. I see reason to take the opportunity to consolidate style a bit, and as a contributor to the docs I find the gratuitous indent unpleasant.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also took the opportunity to unindent the doc.

If it's not too much trouble, please do such changes as separate commits in the future.

@JackStouffer
Copy link
Member

Needs a test case

@andralex andralex force-pushed the 15720 branch 2 times, most recently from ec91b5e to 13e579b Compare May 16, 2017 17:09
@andralex
Copy link
Member Author

ah, forgot to paste the test

@WalterBright
Copy link
Member

Auto-merge toggled on

end = The value that serves as the stopping criterion. This value is not
included in the range.
step = The value to add to the current value at each iteration.
Creates a range of values that span the given starting and stopping values.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mixes whitespace changes and non-whitespace changes. Please never do this.

Even with ?w=1 it's not completely clean because some text has been rewrapped.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok that's a good point

@@ -5553,6 +5552,12 @@ nothrow @nogc @safe unittest
auto t1 = iota(0, 10, 2);
auto t2 = iota(1, 1, 0);
//float overloads use std.conv.to so can't be @nogc or nothrow
alias ssize_t = Unsigned!size_t;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When adding tests for a bug, it's nice to add a comment mentioning the Bugzilla issue number.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@CyberShadow
Copy link
Member

Auto-merge toggled off

@CyberShadow
Copy link
Member

Disabling auto-merge for above feedback, but feel free to re-enable it if you feel these aren't worth addressing.

@andralex
Copy link
Member Author

fixed thx for the reviews

@CyberShadow
Copy link
Member

Merge pull request #4027 from wilzbach/pairwise

I think a stray commit got in.

@andralex
Copy link
Member Author

ugh not sure what happened, lemme fumble around a bit more

@andralex
Copy link
Member Author

Not sure how to reopen this, so I created #5397

@CyberShadow
Copy link
Member

If you close a PR temporarily, make sure you reopen before you push. GitHub doesn't allow reopening PRs if you've pushed to the PR branch while it was closed.

(If you've already pushed, i is still possible to undo the push, reopen, and redo the push, but at that point it's probably easier to open a new PR.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants