DMD 0.166 release

Walter Bright newshound at digitalmars.com
Thu Aug 31 14:05:06 PDT 2006


Russ Lewis wrote:
> Walter Bright wrote:
>> Russ Lewis wrote:
>>> Is there any reason to not use "lazy" as a keyword to modify the
>>> expression, rather than the parameter?
>>>
>>>   void foo(int delegate() dg) {...}
>>>   void bar(int x,int y) {
>>>     foo(lazy x+y);
>>>   }
>>
>> One reason is lazy arguments and non-lazy arguments cannot be passed 
>> to the same function.
> 
> One of us is missing something.  I'm not sure who :)  Can you expand on 
> your response here?

foo(x + y);
foo(lazy x + y);

can't work, because foo needs to know which it is. Just like you can't 
have the same parameter be both in and out.



More information about the Digitalmars-d-announce mailing list