A nice way to step into 2012

Jacob Carlborg doob at me.com
Wed Dec 28 14:02:50 PST 2011


On 2011-12-28 18:54, Timon Gehr wrote:
> On 12/28/2011 05:59 PM, Jacob Carlborg wrote:
>> On 2011-12-28 13:54, bearophile wrote:
>>> Timon Gehr:
>>>
>>>> => expr
>>>>
>>>> should imo be a shorthand for
>>>>
>>>> () => expr.
>>>>
>>>> It saves some ((())(()))().
>>>
>>> It saves few (), but zero argument lambdas aren't that common in my
>>> functional-style code, and I think it decreases syntax uniformity and
>>> code readability. So I think it's a bad idea.
>>
>> It can already be done with the lazy arguments.
>>
>> void foo (lazy int a)
>> {
>> auto b = a();
>> }
>>
>> int bar ();
>> foo(bar());
>>
>
> It is not the same thing. lazy arguments do not create a closure.

Didn't thought of that.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list