Generators in D

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed May 11 08:11:36 PDT 2011


On 05/10/2011 07:06 PM, Piotr Szturmaj wrote:
> I forgot to ask. Any comments or suggestions?

This is solid work, and very interesting. I wonder how we can integrate 
it best with Phobos (e.g. put in its own module vs. integrating into 
std.range).

I suggest you write an article about this artifact. Don't forget that 
the deadline for the iPad contest is June 1st.

A few nits follow.

* "Fiber fiber = Fiber.getThis();" -> "auto fiber = Fiber.getThis();"

* "_generator" -> "Generator" (private names are not exempt from the 
recommended conventions)

* "staticLength!T" -> what's wrong with T.length?

* import inside a template is unusual, why did you need it that way?

* "pure nothrow ValueType front()" -> that probably should be a 
@property (sigh)

* can you implement save() to make this a forward range (e.g. by 
creating a new fiber that has its own state)?


Thanks,

Andrei


More information about the Digitalmars-d mailing list