D Recurrences

Timon Gehr timon.gehr at gmx.ch
Thu Jun 9 08:54:15 PDT 2011


Andrei Alexandrescu wrote:
> On 6/9/11 10:42 AM, Timon Gehr wrote:
>> Ben Grabham wrote:
>>> Also, is there a takeWhile function?
>>> I can't find one in the documents...
>>
>> Not yet, but hopefully there will be:
>> http://d.puremagic.com/issues/show_bug.cgi?id=4535
>
> I think what's unclear is that until() has an overload that takes only
> the predicate and the range. There's no example for that, so the
> definition kinda gets lost in the noise.
>
> // scan range up until the first zero
> auto a = until!"a == 0"(range);
>
>
> Andrei

Oh, I did not know that. That makes things quite a bit better.
Still, takeWhile > until.

Timon


More information about the Digitalmars-d mailing list