Declaration syntax

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Jan 7 22:12:44 PST 2014


On Wed, Jan 08, 2014 at 02:10:04AM +0000, Ross Hays wrote:
> >	pow : real base, real exponent -> real
> >	{
> >		// Variable declaration
> >		tmp1 : real;
> >
> >		// Variable declaration with initializer
> >		result : real = dotDotDotMagic(base, exponent, tmp1);
> >
> >		// Statement as usual
> >		return result;
> >	}
> >
> >
> >T
> 
> I generally prefer the C style declarations that we already have in
> D, but that syntax is pretty nice too...

I like C style declarations too, but as someone said, it's a matter of
what you're accustomed to. The above was just my idea of the what-if
scenario where we redesign D syntax (I doubt it's ever going to happen,
definitely not happening in D2, and probably won't be in D3 either, if
we ever get to that point).


T

-- 
Customer support: the art of getting your clients to pay for your own incompetence.


More information about the Digitalmars-d mailing list