On Wed, 14 Aug 2019, Ryan Joseph wrote:



On Aug 14, 2019, at 12:04 PM, Rainer Stratmann <rainerstratm...@t-online.de> 
wrote:

It’s so
intuitive that basically all languages have adopted the syntax.

That is not true

All languages I use have them: Pascal, C, PHP, C#, Swift, Python, JavaScript. 
These are some of the most popular languages in the world right now. You’re 
fighting a losing battle sir.

I don't see what the issue is ?

You do have +=  and the like. They exist, since about as long as I can remember.

You just cannot use it on properties.

Properties have some other restrictions as well:

* You also cannot Use Inc() on integer properties, * or use Include()/Exclude() on set properties. * You also cannot do SomeRecordProp.X:=Y;
* or pass them to functions that require var arguments.

And I'm probably forgetting some other limitations.

The += is just another one in the list of limitations of properties.

Basically any operation that requires an address is not allowed.
That += is using an address is an implementation detail of the compiler.
Same as Inc() or In/Exclude(). I don't know the exact reason for this 
limitation,
but it's bound to be a good one, otherwise it would have been lifted a long time
ago...

And if someone doesn't like these limitations of properties, (s)he can use fields. No-one abolished those, after all.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to