Reddit: why aren't people using D?

Jarrett Billingsley jarrett.billingsley at gmail.com
Fri Jul 24 14:32:24 PDT 2009


On Fri, Jul 24, 2009 at 5:19 PM, Andrei
Alexandrescu<SeeWebsiteForEmail at erdani.org> wrote:

>> obj.prop op= value;
>>
>> Simply becomes:
>>
>> obj.prop.set(obj.prop.get op value);
>
> I think this would be inefficient in many cases.

Um, what do you have to write now?  "obj.prop = obj.prop op value".
All I'm suggesting is that the compiler automatically transform the
expression for you.

Also, what someone else suggested - that it become "auto temp =
obj.prop get; temp op= value; obj.prop.set(temp)" - is technically
more correct, in terms of operator overloading (i.e. if the property
returns a BigInt, or something).



More information about the Digitalmars-d mailing list