On Fri, 11 Apr 2014 21:05:26 -0400, bearophile <bearophileh...@lycos.com> wrote:

If I have a range like this, how do you find its last item using Phobos?

A simple way is to use seq.array.back, but this wastes memory. Another simple way is to use a foreach loop keeping the last seen. But do you know if there is a function to do in Phobos? And if such function is not present (walkBack? backWalk?) is it a good idea to add it to Phobos?

Interesting problem. Given that it is a forward range, a zip between it and a saved copy that is advanced by one may work.

-Steve

Reply via email to