[Issue 20184] String maxsplit

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 19 18:55:04 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=20184

Berni <dlang at croco-puzzle.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dlang at croco-puzzle.com

--- Comment #6 from Berni <dlang at croco-puzzle.com> ---
I've had a look at this. I think it's not feasable to add an other parameter
"maxsplit" to split. Internally split uses splitter and splitter works with
BidirectionalRange. That means, for implementing back, splitter has to go
through all elements from the front to find the correct breakpoint. That breaks
lazyness, which in my eyes is not desirable.

Therefore I think it would be better to implement separate functions splitN and
splitterN. splitterN would then be restricted to ForwardRange.

--


More information about the Digitalmars-d-bugs mailing list