Re: best way to memoize a range?

2015-09-11 Thread Laeeth Isharc via Digitalmars-d-learn
On Friday, 11 September 2015 at 13:31:06 UTC, John Colvin wrote: On Friday, 11 September 2015 at 13:09:33 UTC, Laeeth Isharc wrote: obviously it's trivial to do with a little aa cache. and I know I can memoize a function, and turn the memoized version into an infinite range. but suppose I

Re: best way to memoize a range?

2015-09-11 Thread John Colvin via Digitalmars-d-learn
On Friday, 11 September 2015 at 13:09:33 UTC, Laeeth Isharc wrote: obviously it's trivial to do with a little aa cache. and I know I can memoize a function, and turn the memoized version into an infinite range. but suppose I have a lazy function that returns a finite range, and its expensive

best way to memoize a range?

2015-09-11 Thread Laeeth Isharc via Digitalmars-d-learn
obviously it's trivial to do with a little aa cache. and I know I can memoize a function, and turn the memoized version into an infinite range. but suppose I have a lazy function that returns a finite range, and its expensive to calculate. can I use Phobos to produce a memoized range? So

Re: best way to memoize a range?

2015-09-11 Thread Jakob Ovrum via Digitalmars-d-learn
On Friday, 11 September 2015 at 13:09:33 UTC, Laeeth Isharc wrote: obviously it's trivial to do with a little aa cache. and I know I can memoize a function, and turn the memoized version into an infinite range. but suppose I have a lazy function that returns a finite range, and its expensive