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

José Mejuto joshyfun at gmail.com
Fri Aug 6 20:02:32 CEST 2010


Hello Adem,

Friday, August 6, 2010, 6:48:22 PM, you wrote:

A> IOW, write a small/simple utility that converts a given source to/from
A> those shorthand operators to/from their long form.
A> If there was such a thing and if it produced code that compiled to give
A> identical results, I would have no problems with the proposal.

Sone questions, what's the result of:

a:=2;
a*=a++;

and:

a:=1;
a:=a++1;

Algebra says one thing, and C a different one. Are ++ operators right
to left ?

And how about non commutative operators ?

a:=1;
a:=2 div a;

How to write it shorter ?

a*=b - 2;

How is this resolved ? a:=a*b-2 or a:=a*(b-2) ?

-- 
Best regards,
 José




More information about the fpc-devel mailing list