template emit(T, alias fun)
I wonder if "template emit(alias fun, T)" wouldn't be a better
idea. That way you could leave T open for type inference, even if
you specify a function. D doesn't support reordering template
arguments, so it's important to put the ones "most used" at the
On Wednesday, 23 March 2016 at 17:43:07 UTC, Tamas wrote:
On Wednesday, 23 March 2016 at 17:29:55 UTC, Nick Treleaven
wrote:
On Monday, 21 March 2016 at 23:09:27 UTC, Tamas wrote:
On Monday, 21 March 2016 at 11:48:52 UTC, Seb wrote:
Could you try to point out whats wrong with map & filter?
On Monday, 21 March 2016 at 23:09:27 UTC, Tamas wrote:
On Monday, 21 March 2016 at 11:48:52 UTC, Seb wrote:
Could you try to point out whats wrong with map & filter?
It's hard to do stuff like this:
assert(9.iota.emit!(int,(put,a){if(a%2) put(a*a); if(a%3==0)
On Monday, 21 March 2016 at 11:48:52 UTC, Seb wrote:
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]))
I support idea to have such feature, sometimes it really need.
Could you try to point out whats
On Wednesday, 23 March 2016 at 17:29:55 UTC, Nick Treleaven wrote:
On Monday, 21 March 2016 at 23:09:27 UTC, Tamas wrote:
On Monday, 21 March 2016 at 11:48:52 UTC, Seb wrote:
Could you try to point out whats wrong with map & filter?
It's hard to do stuff like this:
On Monday, 21 March 2016 at 23:09:27 UTC, Tamas wrote:
On Monday, 21 March 2016 at 11:48:52 UTC, Seb wrote:
Could you try to point out whats wrong with map & filter?
It's hard to do stuff like this:
assert(9.iota.emit!(int,(put,a){if(a%2) put(a*a); if(a%3==0)
On Monday, 21 March 2016 at 11:48:52 UTC, Seb wrote:
Could you try to point out whats wrong with map & filter?
It's hard to do stuff like this:
assert(9.iota.emit!(int,(put,a){if(a%2) put(a*a); if(a%3==0)
put(a);}).equal([1,9,3,25,6,49]));
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])
given fun(put, a) a lambda that can call $put 0 or more times,
some_range.emit!fun computes a range formed of all the calls to $put
eg:
assert(9.iota.emit!(int,(put,a){if(a%2) put(a*a);}).equal([1, 9, 25, 49]));
in this case it can be done by combining map and filter but in other cases
emit is