Bug 8087 – Improve clarity of std.algorithm documentation

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-05-11T12:21:00Z
Last change time
2017-01-16T23:24:25Z
Keywords
bootcamp
Assigned to
alexandru.razvan.c
Creator
bugzilla
Blocks
16614

Comments

Comment #0 by bugzilla — 2012-05-11T12:21:36Z
1. copy's prototype is: Range2 copy(Range1, Range2)(Range1 source, Range2 target); It would be more self-documenting written as: OutputRange copy(InputRange, OutputRange)(InputRange source, OutputRange target); In general, for all the algorithms that deal with ranges, the range types should be named after the type of range expected - ForwardRange, InputRange, BidirectionalRange, etc. 2. map has inconsistent use of element names - calling it x in the description and e in the example code. Should use the same name in each. Check other descriptions for similar issues. 3. joiner should include a "See Also" link to the very similar std.range.chain
Comment #1 by bearophile_hugs — 2014-11-10T09:22:10Z
(In reply to Walter Bright from comment #0) > In general, for all the algorithms that deal with ranges, the range types > should be named after the type of range expected - ForwardRange, InputRange, > BidirectionalRange, etc. It's even conceivable for the compiler to enforce this wise rule.
Comment #2 by github-bugzilla — 2014-11-11T22:30:38Z
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/a33ef931bfcbea3278a66fee729c6cc9da0089f3 Merge pull request #2668 from quickfur/issue8087 Partial fix for issue 8087: improve std.algorithm documentation
Comment #3 by hsteoh — 2014-11-19T16:18:25Z
Now that sig constraints are included in ddoc's output, is (1) still an issue? The declaration of std.algorithm.copy is now: Range2 copy(Range1, Range2)(Range1 source, Range2 target) if (isInputRange!Range1 && isOutputRange!(Range2, ElementType!Range1)); (2) and (3) have been addressed by the PR that merged.
Comment #4 by github-bugzilla — 2015-02-18T03:39:43Z
Comment #5 by alexandru.razvan.c — 2016-10-30T18:46:40Z
https://github.com/dlang/phobos/pull/4883 Regarding (1), since this bug was created the file hierarchy seems to have changed. I updated the files from std/algorithm as explained in the original post. Awaiting feedback.
Comment #6 by alexandru.razvan.c — 2016-10-30T18:48:16Z
https://github.com/dlang/phobos/pull/4883 Regarding (1), since this bug was created the file hierarchy seems to have changed. I updated the files from std/algorithm as explained in the original post. Awaiting feedback.
Comment #7 by github-bugzilla — 2016-11-01T22:23:38Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/946a46774c58681036e12932858d0bb58f887448 Fix Issue 8087 - Improve clarity of std.algorithm documentation https://github.com/dlang/phobos/commit/fd518eb310a9494cccf28c54892542b052c49669 Merge pull request #4883 from Darredevil/issue-8087 Fix Issue 8087 - Improve clarity of std.algorithm documentation
Comment #8 by github-bugzilla — 2016-12-27T13:11:09Z
Commits pushed to scope at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/946a46774c58681036e12932858d0bb58f887448 Fix Issue 8087 - Improve clarity of std.algorithm documentation https://github.com/dlang/phobos/commit/fd518eb310a9494cccf28c54892542b052c49669 Merge pull request #4883 from Darredevil/issue-8087
Comment #9 by github-bugzilla — 2017-01-07T03:02:26Z
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/946a46774c58681036e12932858d0bb58f887448 Fix Issue 8087 - Improve clarity of std.algorithm documentation https://github.com/dlang/phobos/commit/fd518eb310a9494cccf28c54892542b052c49669 Merge pull request #4883 from Darredevil/issue-8087
Comment #10 by github-bugzilla — 2017-01-16T23:24:25Z
Commits pushed to newCTFE at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/946a46774c58681036e12932858d0bb58f887448 Fix Issue 8087 - Improve clarity of std.algorithm documentation https://github.com/dlang/phobos/commit/fd518eb310a9494cccf28c54892542b052c49669 Merge pull request #4883 from Darredevil/issue-8087