emit: generalizes map, filter, joiner [proposal + implementation]

Seb via Digitalmars-d digitalmars-d at puremagic.com
Mon Mar 21 04:48:52 PDT 2016


On Monday, 21 March 2016 at 11:35:49 UTC, Timothee Cour wrote:
> assert(9.iota.emit!(int,(put,a){if(a%2) put(a*a);}).equal([1, 
> 9, 25, 49]))

Could you try to point out whats wrong with map & filter?

assert(9.iota.filter!"a%2".map!"a*a".equal([1, 9, 25, 49])


More information about the Digitalmars-d mailing list