<div dir="ltr"><div>given fun(put, a) a lambda that can call $put 0 or more times,</div><div>some_range.emit!fun computes a range formed of all the calls to $put</div><div><br></div><div>eg:</div><div>assert(9.iota.emit!(int,(put,a){if(a%2) put(a*a);}).equal([1, 9, 25, 49]));</div><div><br></div><div>in this case it can be done by combining map and filter but in other cases emit is more powerful and an equivalent (with map,filter,joiner) can be inefficient and more complex.</div><div><br></div><div>seeĀ <a href="https://github.com/timotheecour/dtools/blob/master/dtools/util/emit.d">https://github.com/timotheecour/dtools/blob/master/dtools/util/emit.d</a></div><div><br></div><div>could that be turned into std.algorithm.iteration.emit (after addressing comments) ?</div><div><br></div><div>Any comments would be appreciated (especially regarding whether we can get rid of the 1st template argument with type deduction)</div><div><br></div><div><br></div><div><br></div></div>