While we're lynching features, how bout' them omittable parens?

Leandro Lucarella llucax at gmail.com
Tue May 19 07:12:13 PDT 2009


Steven Schveighoffer, el 19 de mayo a las 09:54 me escribiste:
> >So for me, properties are way more than just syntax sugar.
> 
> AFAIK, this is not enforced by the compiler...
> 
> I write C# properties that have side effects.

Well, in D2 it would make sense to make mandatory that properties are pure
=)

I think the actual syntax is really nice and simple, the only thing
missing is a way to declare that you expect some function to be
a property.

Something like this should be enough for me:

class C
{
	int no_prop() { return 1; }
	property int prop() { return 2; }
}

C c = new C;
int x = c.no_prop; // error
x = x.prop; // ok

"property" should imply "pure".

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------



More information about the Digitalmars-d mailing list