Circular Buffer

Tobias Pankrath tobias at pankrath.net
Thu Feb 13 12:40:20 PST 2014


On Monday, 10 February 2014 at 03:14:31 UTC, Jonathan Dunlap 
wrote:
> (disclaimer: I'm new around here)
> Is it possible to cycle backwards? If not, what's the best 
> approach?
>
> Example of some ideal "takeBack" function:
> data = cycle([1,2,3][])
> take(data, 4) is [1,2,3,1][]
> takeBack(data, 4) would be [1,3,2,1][]
>
> Thoughts?

I don't think it is currently possible, but it shouldn't be hard 
to make retro work with cycle.


More information about the Digitalmars-d-learn mailing list