I think I have just found a pattern to ease the pain of @nogc
programming somewhat. Consider this:
import std.algorithm;
import std.range;
@nogc void main()
{ import core.stdc.stdio;
int power = 2;
foreach
( raised;
iota(10)
.dropOne
.map!(num => num^^pow
On Saturday, 16 June 2018 at 11:58:47 UTC, Dukc wrote:
snip]
What are your thoughts? Do you agree with this coding pattern?
I like it.
On Saturday, 16 June 2018 at 11:58:47 UTC, Dukc wrote:
What are your thoughts? Do you agree with this coding pattern?
It would even be better if map can recognize tuples and thus
allows to simply use a lambda functions with two parameters, but
in the past with a few exceptions there hasn't b
On Sunday, 17 June 2018 at 13:50:31 UTC, Seb wrote:
On Saturday, 16 June 2018 at 11:58:47 UTC, Dukc wrote:
What are your thoughts? Do you agree with this coding pattern?
It would even be better if map can recognize tuples and thus
allows to simply use a lambda functions with two parameters,
On Sunday, 17 June 2018 at 20:17:36 UTC, Dukc wrote:
Yes, I agree. And each too, of course.
Thought again and not so sure anymore: I just realized that if we
are to do that, it should apply the same changes to tee, find,
filter etc. Probably too complicated to be worth it.
For @nogc, there
On Monday, 18 June 2018 at 06:54:46 UTC, Dukc wrote:
On Sunday, 17 June 2018 at 20:17:36 UTC, Dukc wrote:
Yes, I agree. And each too, of course.
Thought again and not so sure anymore: I just realized that if
we are to do that, it should apply the same changes to tee,
find, filter etc. Proba