On 2013-01-30 03:15, Rob T wrote:

Even with @property restrictions, I still don't think it will work as
expected. For example, if the variable is a struct, then you have to
disallow operations on the struct from outside.

Example:

struct Y { int a; }

struct X{ @property Y y; }

X x;

x.y.a = 4; // <- this has to be illegal!

Reason?

struct X{

   Y _y;

   @property Y y{ return _y; }

}

// this won't change _y as it did before.
x.y.a = 4;

That would require some property rewrite by the compiler.

--
/Jacob Carlborg

Reply via email to