[fpc-devel] Proposal: Enhanced replacement for assignment operators

Alexander Klenin klenin at gmail.com
Fri Aug 6 19:53:14 CEST 2010


On Sat, Aug 7, 2010 at 04:35, Martin <fpc at mfriebe.de> wrote:
>  On 06/08/2010 17:38, Alexander Klenin wrote:
>> Code bloat/duplication is much more serious.
>> It is usually not just SomeReallyLongVariableNameY, but something like:
>> SomeFunctionReturningObject(param1, param2).PointArrayField[i] +=
>> FunctionReturningPointOffset(param);
>> Try rewriting that without "+=".
>>
> How is that defined?

As usual, by-field addition.

> I tried earlier to use += on a property => and got a compile error.
> If it works like this for you, then obviously += work on some, but not all
> properties? Interesting...

No, FPC team did a good job destroying this functionality ;-)
This is why I specifically wrote PointArrayField, not PointArrayIndexedProperty.

-- 
Alexander S. Klenin



More information about the fpc-devel mailing list