Eigenpoll : D wish list : Explicit property keyword
Please use this item for vote for "Explicit 'property' keyword", there is bug in "Explicit 'property' keyword", which doesn't allow to select it in the vote list, so this item is quick fix.
Sometimes it is not so convenient to expose every function as a property (i.e. it was designed to call a function explicitly).
I propose to introduce the 'property' keyword to explicitly declare a property. I suggest several ways to declare properties.
as follows:
class Foo
{
.....
//prefix
property uint MyProperty() {return MyUint;}//read
//full (scoped declarations is easy to read)
property
{
uint MyProperty2(){return MyUInt;}//read
uint MyProperty2(uint value){MyUInt = value; return MyUInt;} //write
char[] AnotherProperty...
}
//another way (single declaration)
property(uint MyProperty3)
{
get{return MyUint;}
set{MyUint = value; return MyUInt;} //it needs to introduce 3 new keywords: get, set, value (C# way)
}
}
Report this item for cleanup