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 it
like this:

   void test(T...)(lazy T args)
   {
       foreach(I, _; typeof(args))
       {
           writeln("about to process arg");
           writefln("processing arg %s",args[I]);
       }
   }

artur

Reply via email to