On 2011-08-11 14:10, zhang wrote:
I think D needs user defined attributes first.

About attribute, here is an example:

class ClassA
{
     private int m_data;
     @property int data() { return m_data; }
     @property int data(int value) { return m_data = value; }
}


int main(string[] args)
{
     ClassA aClass = new ClassA();

     aClass.data = 22;
     writefln("%d", aClass.data);

     return 0;
}

========================
There is a problem that is D's basic type is not nullable. In C#, the nullable integer type can be 
defined as "Int?" or "Nullable<int>".

You mean to indicate the attribute doesn't have a value?

--
/Jacob Carlborg

Reply via email to