Name a phobos function!

Mark Lagodych lgd.mrk at gmail.com
Tue Mar 16 21:49:28 UTC 2021


On Monday, 15 March 2021 at 13:35:24 UTC, Dukc wrote:
> I am currently authoring a pull request to Phobos, here: 
> https://github.com/dlang/phobos/pull/7794. I'm trying to get a 
> new function added. Currently it's named `splitBy`, and it's 
> behaviour is probably best described by documentation:
>
> -------------------------
> Splits a forward range into subranges in places determined by a 
> binary predicate. When iterating, one element of `r` is 
> compared with `pred` to the next element. If `pred` return 
> true, a new subrange is started for the next element. 
> Otherwise, they are part of the same subrange. If the elements 
> are compared with an inequality (!=) operator, consider $(LREF 
> chunkBy) instead, as it's likely faster to execute.

chopBy()
chop()
subrangeBy()


More information about the Digitalmars-d mailing list