Impressed
Jonathan M Davis
jmdavisProg at gmx.com
Fri Jul 27 00:29:44 PDT 2012
On Friday, July 27, 2012 09:27:55 Simen Kjaeraas wrote:
> On Fri, 27 Jul 2012 05:24:08 +0200, Nick Sabalausky
>
> <SeeWebsiteToContactMe at semitwist.com> 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
More information about the Digitalmars-d
mailing list