[fpc-pascal] Re: ++ and -- ( and +=, -=, ...)
Gerhard Scholz
gs at g--s.de
Thu Aug 1 12:22:24 CEST 2013
Semantically, it's not the same, but
a += b
can be replaced by
inc ( a, b ) ;
It's readable, it looks like normal standard Pascal; and it's clear that the
address of a is
calculated only once.
If a,b are not ordinals, inc could be overloaded.
Greetings
Gerhard
----- Original Message -----
From: "Graeme Geldenhuys" <graeme at geldenhuys.co.uk>
To: <fpc-pascal at lists.freepascal.org>
Sent: Wednesday, July 31, 2013 12:54 PM
Subject: Re: [fpc-pascal] Re: ++ and -- ( and +=, -=, ...)
> On 2013-07-30 22:42, leledumbo wrote:
>>
>> People who uses C style short unreadable code approach
>> usually state they get more optimized code, yet the compiler is actually
>> able to produce the same with optimizations turned on.
>
> No, I simply prefer to use += and -= because it is easier to read the
> code (for me at least). But with the added restrictions applied in
> recent FPC releases (eg: those shortcuts don't work with properties any
> more) I am slowly forced to move back to the verbose a := a + b syntax.
> :-/
>
>
> Regards,
> Graeme.
>
>
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
More information about the fpc-pascal
mailing list