On Friday, July 27, 2012 09:27:55 Simen Kjaeraas wrote: > On Fri, 27 Jul 2012 05:24:08 +0200, Nick Sabalausky > > <[email protected]> wrote: > >> foreach(i; recurrence!(a => a[n-1] + 2)(0)) > > > > Erm, should be: > > foreach(i; recurrence!"a[n-1] + 2"(0)) > > or just > foreach(i; recurrence!((a,n) => a[n-1] + 2)(0))
Yeah. You can do a lot with infinite and generative ranges. That's one of the reasons that they're so much better than iterators (though it sounds like you can do some interesting things with C# interators that you can't do with most other types of iterators). - Jonathan M Davis
