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

Martin fpc at mfriebe.de
Fri Aug 6 19:35:05 CEST 2010


  On 06/08/2010 17:38, Alexander Klenin wrote:
> On Sat, Aug 7, 2010 at 03:10, "Vinzent Höfler"
> <JeLlyFish.software at gmx.net>  wrote:
>>> You don't have to spend time realizing that it's the same variable (not
>>> e.g. SomeReallyLongVariableNameY) if you read the 1st form.
>> But you can mistake the "+=" for a ":=". Replacing one possible reading error with another isn't much of an improvement.
> You can also mistake "." for ",", ">=" for "<=", or mix up "<>","><",
> "<<" and">>" --
> which are all valid but different symbols in FPC. This is quite a minor problem.
>
> 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?

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...




More information about the fpc-devel mailing list