On Thursday, 13 April 2017 at 05:51:27 UTC, Dukc wrote:
auto use(alias F, T)(T t){return F(t);}
void main()
{ import std.stdio;
foreach(i; 1 .. 11)
{ foreach(j; 1 .. 11) write((i * j).use!(x => x*x), " ");
writeln;
}
}
forgot three letters:
auto use(alias F, T...)(T
On Thursday, 13 April 2017 at 11:16:46 UTC, crimaniak wrote:
If fact you don't need any template to do this. Try the next:
foreach(i; 1 .. 11)
{ foreach(j; 1 .. 11) write((x => x*x)(i * j), " ");
writeln;
}
True, that's a good trick too. But I prefer the template at
On Thursday, 13 April 2017 at 11:16:46 UTC, crimaniak wrote:
On Thursday, 13 April 2017 at 05:51:27 UTC, Dukc wrote:
auto use(alias F, T)(T t){return F(t);}
void main()
{ import std.stdio;
foreach(i; 1 .. 11)
{ foreach(j; 1 .. 11) write((i * j).use!(x => x*x), " ");
On Wednesday, 12 April 2017 at 21:40:48 UTC, bluecat wrote:
What are some features that you have discovered that you would
like to share with the community? For me, one thing I found
interesting was the ability to define structures dynamically
using mixins:
import std.stdio;
import
On Thursday, 13 April 2017 at 05:51:27 UTC, Dukc wrote:
auto use(alias F, T)(T t){return F(t);}
void main()
{ import std.stdio;
foreach(i; 1 .. 11)
{ foreach(j; 1 .. 11) write((i * j).use!(x => x*x), " ");
writeln;
}
}
This way, you can avoid writing long expressions
On Wednesday, 12 April 2017 at 21:40:48 UTC, bluecat wrote:
What are some features that you have discovered that you would
like to share with the community? For me, one thing I found
interesting was the ability to define structures dynamically
using mixins:
import std.stdio;
import
On Wednesday, 12 April 2017 at 21:40:48 UTC, bluecat wrote:
What are some features that you have discovered that you would
like to share with the community?
auto use(alias F, T)(T t){return F(t);}
void main()
{ import std.stdio;
foreach(i; 1 .. 11)
{ foreach(j; 1 .. 11) write((i *
On Wednesday, 12 April 2017 at 21:40:48 UTC, bluecat wrote:
What are some features that you have discovered that you would
like to share with the community? For me, one thing I found
interesting was the ability to define structures dynamically
using mixins:
import std.stdio;
import
What are some features that you have discovered that you would
like to share with the community? For me, one thing I found
interesting was the ability to define structures dynamically
using mixins:
import std.stdio;
import std.format: format;
template MakePoint(string name, string x, string