Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
January 28, 2007 Simple and quite easy to use iterator library for D | ||||
---|---|---|---|---|
| ||||
Hello, http://smp.if.uj.edu.pl/~baryluk/d/iterators-1.0.tar.gz documentation and samples included. Feel free to comment, providing bug report, or nice examples. :) Performance note: about 5% slowdown in comparison to hand writen loops. Examples: class Naturals(int n) { int iter() { for (int i = 1; i <= n; i++) yield(i); return 0; } mixin mainiter!(int, iter); // mixin iterator's stuff } ... foreach (int x; new Naturals!(10)()) { ... } Multiple iterators: class MNaturals(int n) { int iter2(Iterator!(double) x) { for (int i = 1; i <= n; i++) x.yield(i*i); return 0; } mixin inneriter!(double, iter2) squers; int iter3(Iterator!(double) x) { for (int i = 1; i <= n; i++) x.yield(i*i*i); return 0; } mixin inneriter!(double, iter3) qubes; } ... auto s = new MNaturals!(10)(); foreach (int x; s.squers.ic()) { ... } foreach (int x; s.qubes.ic()) { ... } -- Witold Baryluk |
January 28, 2007 Re: Simple and quite easy to use iterator library for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Witold Baryluk | Witold Baryluk wrote:
> Hello,
>
> http://smp.if.uj.edu.pl/~baryluk/d/iterators-1.0.tar.gz
>
> documentation and samples included.
>
> Feel free to comment, providing bug report, or nice examples. :)
>
> Performance note: about 5% slowdown in comparison to hand writen loops.
>
Is it compatible with Tango. ;-P
--bb
|
January 29, 2007 Re: Simple and quite easy to use iterator library for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Witold Baryluk | Witold Baryluk wrote:
> Hello,
>
> http://smp.if.uj.edu.pl/~baryluk/d/iterators-1.0.tar.gz
>
> documentation and samples included.
>
> Feel free to comment, providing bug report, or nice examples. :)
>
>
You looking for SVN hosting?? If you want, I'll let you put it in scrapple on dsource.
|
January 30, 2007 Re: Simple and quite easy to use iterator library for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to BCS | Dnia Mon, 29 Jan 2007 11:17:26 -0800 BCS <BCS@pathlink.com> napisaĆ/a: > Witold Baryluk wrote: > > Hello, > > > > http://smp.if.uj.edu.pl/~baryluk/d/iterators-1.0.tar.gz > > > > documentation and samples included. > > > > Feel free to comment, providing bug report, or nice examples. :) > > > > > > You looking for SVN hosting?? If you want, I'll let you put it in scrapple on dsource. Thx, feel free to do this. I have, svn and cvs hosting, on two big servers. But they are for private development. I will probably, configure everything after exams in my school, and make some nice page for this and other (not completed) D programs, and other discontinued projects in C (now i will probably enthusiastically port them to D quickly, and release them - 5 of them can be really useful :D). Unfortunetly i can't legally point any non-edu domain to these servers, so i also don't see a point in creating special page for it. Ah, and i have some problems with forward references (like bug#102) in dmd, and can't go with development. :( -- Witold Baryluk MAIL: baryluk@smp.if.uj.edu.pl, baryluk@mpi.int.pl JID: movax@jabber.autocom.pl |
January 30, 2007 Re: Simple and quite easy to use iterator library for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Witold Baryluk | Reply to Witold,
> Dnia Mon, 29 Jan 2007 11:17:26 -0800
> BCS <BCS@pathlink.com> napisal/a:
>> Witold Baryluk wrote:
>>
>>> Hello,
>>>
>>> http://smp.if.uj.edu.pl/~baryluk/d/iterators-1.0.tar.gz
>>>
>>> documentation and samples included.
>>>
>>> Feel free to comment, providing bug report, or nice examples. :)
>>>
>> You looking for SVN hosting?? If you want, I'll let you put it in
>> scrapple on dsource.
>>
> Thx, feel free to do this.
>
If you have a dsource account I'll set you up with dev access. Just send me a username. I'll dump in the tar and add the .html for now.
|
Copyright © 1999-2021 by the D Language Foundation