Hello, World!
Max Samukha
maxsamukha at gmail.com
Wed Mar 30 18:50:40 UTC 2022
On Wednesday, 30 March 2022 at 15:49:08 UTC, H. S. Teoh wrote:
>
> And pragma(msg) is technically not your program outputting the
> message,
> but the compiler. You need to put it in main() for a proper
> implementation of Hello World. ;-)
>
>
> T
template add(int x)
{
pragma(msg, x);
int add(int y)
{
import std.stdio: writeln;
writeln(y);
return x + y;
}
}
void main()
{
auto z = add!1(2);
}
Is this a program that starts at compile time and continues at
run time, or a meta-program that generates another program? )
More information about the Digitalmars-d
mailing list