Properties: a.b.c = 3

Kagamin spam at here.lot
Fri Jul 31 06:07:37 PDT 2009


Andrei Alexandrescu Wrote:

> Bill Baxter wrote:
> > Yeh, I don't understand how any of this has anything to do with
> > properties.  It's the same question if you ask what should
> > 
> >  a.b().c = 5
> > 
> >  do.  It's the same issue whether you have properties or not, and
> > needs a solution whether you have properties or not.
> 
> Well the problem is that a.b().c = 5 makes it clear that there's a 
> function call in the mix, so the field-like behavior is not necessarily 
> to be expected.

This is a matter of coding style I believe.

widget.clientRectangle.width=10;
widget.getRectangle(Rects.clientRectangle).width=10;

Should the meaning of this code change depending on whether the return value is reference type or value type?

Looks like C# rules forbid implementation of smart pointers and structs are supposed to be simply composite types rather than generic value types.



More information about the Digitalmars-d mailing list