On Sun, 19 Dec 2010 17:51:34 +0200, Jacob Carlborg <d...@me.com> wrote:
On 2010-12-19 01:01, Walter Bright wrote:
Simen kjaeraas wrote:
The problem of D's lambda syntax is it is optimized for longer
functions. Usually, the delegates I write are one line long. I cannot
see that this syntax collides with anything at the moment, but feel
free
to enlighten me:
{ => 4; }
{ a => 2*a; }
{ a, b => a>b; }
{ => @ + @; } // turns into { a, b => a + b; }
If size and simplicity of typing are critical, are those really better
than:
"a>b"
?
No, that syntax is not better.
Ignoring technical limitations:
"a>b"
is to me, looks million times better than these 4 or other absurd syntaxes
proposed on this thread.
{ => 4; }
{ a => 2*a; }
{ a, b => a>b; }
{ => @ + @; } // turns into { a, b => a + b; }
You might call this a hack, fine!
--
Using Opera's revolutionary email client: http://www.opera.com/mail/