property / getProperty() / setProperty()

Rainer Deyke rainerd at eldwood.com
Sat Aug 1 13:25:11 PDT 2009


Jarrett Billingsley wrote:
> On Sat, Aug 1, 2009 at 2:38 PM, Ary Borenszweig<ary at esperanto.org.ar> wrote:
>> auto a = x; // OK
>> auto a = x(); // Wrong
>> x = 2; // OK
>> x(2); // Wrong
> 
> And furthermore, I mentioned that &obj.foo would always get the
> address of the member 'foo' from 'obj', even if 'foo' was a property.

That's the part of this proposal I don't like.  The getter of a property
is not the property itself, and should not have the same name.  It's
confusing that '&x.y' is a delegate but 'x.y' is not a method.  In
short, this proposal fails to fix the conceptual problem with the way
properties are handled in D right now.


-- 
Rainer Deyke - rainerd at eldwood.com



More information about the Digitalmars-d mailing list