[fpc-devel] Proposal: Enhanced replacement for assignment operators
klenin at gmail.com
Fri Aug 6 20:40:48 CEST 2010
On Sat, Aug 7, 2010 at 04:52, Martin <fpc at mfriebe.de> wrote:
> "aesthetically dislike " = bad readability => see above...
Not quite. For example I dislike indentation by three spaces, and "begin"s
at the start of line, but both of those do not really impede my code reading.
OTOH, inconsistent indentation and begin placement distract
me so much that I sometimes prefer to reformat code before reading.
> Well yes, having a different symbol, is not good (I wrote I did not like it)
> => but having "div=" is equally not good. That leaves the option of having
> neither. => Having neither is the answer you should always find to, if all
> known alternatives are at best a (bad) compromise.
> But to follow up, if <op>= was allowed for all and any op:
> BoolVal == OtherBool; // BoolVal := Boolval = OtherBool;
> There is nothing wrong with it => except I wouldn't be to sure, how many
> people would actually read the correct meaning into it, if they did not know
Yes, in that sense maybe original poster's proposal of retaining colon
in assignment operator is a good idea ("+:=" vs "+=").
Unfortunately, it is too late for that.
Another interesting but unrealistic option is something like
a :=[+] b;
I can even concede to use a function-like syntax, as long as it is
Reduce(a, +, b);
Alexander S. Klenin
More information about the fpc-devel