Bug 11429 – Deprecate walkLength?

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-03T06:39:00Z
Last change time
2017-07-05T16:03:17Z
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2013-11-03T06:39:25Z
This is an alternative to issue 8467. If issue 8467 is refused, then I suggest to just deprecate walkLength, and leave only count(), because it can replace walkLength (if count lacks the ".length" shortcut optimization, it should be added): import std.algorithm: count, map; void main() { assert([0, 0, 1].map!(x => x).count == 3); }
Comment #1 by jack — 2016-04-05T02:16:25Z
I think this is a bad idea, walkLength is not only a clearer name than an empty count, but it's used quite widely. Phobos alone has 133 uses of it.
Comment #2 by greeenify — 2016-04-10T00:02:57Z
Hmm I personally like count a lot more and there is already minCount and maxCount in std.algorithm
Comment #3 by dlang-bugzilla — 2017-07-02T02:39:58Z
A controversial and high-impact rename is not really directly actionable as an enhancement.
Comment #4 by razvan.nitu1305 — 2017-07-05T16:03:17Z
(In reply to Vladimir Panteleev from comment #3) > A controversial and high-impact rename is not really directly actionable as > an enhancement. The length optimization should be added either way