How to make rsplit (like in Python) in D

cym13 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Oct 1 11:15:55 PDT 2016


On Saturday, 1 October 2016 at 17:23:16 UTC, Uranuz wrote:
> On Saturday, 1 October 2016 at 16:45:11 UTC, Uranuz wrote:
>> How to make rsplit (like in Python) in D without need for 
>> extra allocation using standard library? And why there is no 
>> algorithms (or parameter in existing algorithms) to process 
>> range from the back. Is `back` and `popBack` somehow worse 
>> than `front` and `popFront`.
>>
>> ...

I'm glad to see you found your way on your own.

Just a note about your remark on backward range processing: an 
important thing to understand many peculiarities of Phobos is 
that ranges are supposed to be possibly infinite until proven 
otherwise. In practice that means that bidirectional ranges will 
allow you to work backward, but that as algorithms are generic 
they generally aren't designed specifically for those ranges.


More information about the Digitalmars-d-learn mailing list