Lambda syntax, etc

Bill Baxter wbaxter at gmail.com
Wed Feb 4 21:57:50 PST 2009


On Thu, Feb 5, 2009 at 2:56 PM, Bill Baxter <wbaxter at gmail.com> wrote:
> On Thu, Feb 5, 2009 at 2:30 PM, Nick Sabalausky <a at a.a> wrote:
>>>> 2) A ruby-like syntax for delegate literals : {|a,b| return a+b;}
>>>
>>> I don't like that
>>>
>>
>> The thing I like about that is that it makes it much more clear at a glance
>> that the "a,b" or "int a, int b" is associated with the code block (but
>> without the problem some languages have of making it hard to distinguish
>> from the block's body).
>
> I agree.  Putting the args inside the { } is much more readable to me too.
> Even just putting the parens inside rather than outside seems an improvement.
>
> Or how about
>
>  { int x; int y :: return x+y; }

Oh, and last semicolon of a function should be optional :-)

    { int x; int y :: return x+y }

--bb



More information about the Digitalmars-d mailing list