Ok,I've found a post that could be useful: http://www.digitalmars.com/d/archives/digitalmars/D/yield_C_etc_74821.html and there's a Generator mixin in generators.d, from the libs_d library: http://www.fantascienza.net/leonardo/so/index.html I'll give these a try soon.