On 09/25/2015 05:56 AM, Sean Campbell wrote:
Take the following code for example
module test;
import std.stdio;
void test(T...)(lazy T args)
I don't think that syntax is implemented. It looks valid to me though.
There are many qualifier combinations that the compiler is silent about.
I
On 09/25/15 17:47, Ali Çehreli via Digitalmars-d-learn wrote:
> Perhaps we need an enhancement that either works in your original code [...]
His original code does work (`foreach` evaluates `args[N]` and
assigns the result to `arg`).
If he wanted to delay the evaluation, he would have written
On 09/25/2015 09:38 AM, Artur Skawina via Digitalmars-d-learn wrote:
On 09/25/15 17:47, Ali Çehreli via Digitalmars-d-learn wrote:
Perhaps we need an enhancement that either works in your original code [...]
His original code does work (`foreach` evaluates `args[N]` and
assigns the result to
Take the following code for example
module test;
import std.stdio;
void test(T...)(lazy T args)
{
foreach(arg;args) //bar is invoked here
{
writeln("about to process arg");
writefln("processing arg %s",arg); //but it should be invoked
here, right?
}
}