new D2.0 + C++ language

Daniel Keep daniel.keep.lists at gmail.com
Sat Mar 21 03:04:43 PDT 2009



bearophile wrote:
> Jarrett Billingsley:
>>> Pointer syntax of Pascal is better, and the := �= often avoid the C bugs like if(a = b).
>> Which isn't a problem in D ;)
> 
> Let's say D has a workaround to patch most of that C-syntax hole :-)
> And I'll never like C pointer syntax.
> 
> 
>> That's actually pretty nice.
> 
> An alternative syntax that avoids the two nested {{}}:
> Lambda functions:
> {int x -> x*x}
> {x -> x*x}
> {float x, float x*y}
> Lambda delegates:
> {int x => x*x}
> {x => x*x}
> {float x, float y => x*y}
> 
> I may even like that :-)
> 
> Bye,
> bearophile

{ int -> int } // function
{ this int -> int } // delegate

Not saying I support this syntax; just proposing an alternative.  The
way I see it, there's no reason why functions are -> and delegates are
=>; the difference is non-obvious.

  -- Daniel



More information about the Digitalmars-d mailing list