Lazy evaluation of function arguments in D
Roman D. Boiko
rb at d-coding.com
Sun May 20 12:09:18 PDT 2012
On Sunday, 20 May 2012 at 18:59:22 UTC, deadalnix wrote:
> Le 20/05/2012 17:59, David Nadlinger a écrit :
>> On Sunday, 20 May 2012 at 15:41:05 UTC, deadalnix wrote:
>>> If so, this isn't complicated, just do some rewrite magic on
>>> the
>>> expression if it is given and expression where a delegate is
>>> expected.
>>
>> Lazy parameters once used to work like this (back in the D1
>> times,
>> before there even was a »lazy« storage class), but not
>> everybody was
>> happy with it – among other discussions, you should be able
>> to find a
>> thread named something along the lines of »But I don't want
>> my delegates
>> to be lazy« in the NG archives.
>>
>> David
>
> Thank for the information. I think this thread have some good
> point but :
> 1/ Nobody is even considering pure/nothrow/@safe .
> 2/ Many problems are not solved with lazy.
>
> lazy in itself isn't bad, but it don't play well with other
> features of the language.
>
> A language that have many feature that don't integrate nicely
> with one another already exists. It is called C++, it is a
> reason that lead to D. We can do the same mistake again and
> again, but it seems that E already exists.
I rather agree. However, if the language doesn't provide some
feature it doesn't mean there is no way to accomplish the task. I
would be interested to know how to do it.
More information about the Digitalmars-d
mailing list