On Wed, Jan 12, 2011 at 21:24, Michael Schnell <mschn...@lumino.de> wrote:
> += does work for variables, even Strings.
>
> AFAIR, there already has been a discussion about += and friends for
> properties.
>
> In fact I don't see why the compiler not just generates "x.a := x.a + y"
> from "x.a += y" before doing any code generating, disregarding what x.a is.
> Of course an error message will occur if x.a is not writable for any reason.
>

Blindly replacing "a += b" with "a := a + b" may lead to a semantic change
if "a" is an expression with side-effects.
Nevertheless, I do think that implementing += for properties is a good idea,
but unfortunately FPC developers disagree.

-- 
Alexander S. Klenin
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to