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

Alexander Klenin klenin at gmail.com
Fri Aug 6 16:45:30 CEST 2010

On Sat, Aug 7, 2010 at 01:37, Martin <fpc at mfriebe.de> wrote:
>  On 06/08/2010 15:23, Alexander Klenin wrote:
>> On Sat, Aug 7, 2010 at 01:12, Martin<fpc at mfriebe.de>  wrote:
>> What it the difference? I agree that "%" is slightly better notation than
>> "mod",
>> but that is totally insignificant, and since we are stuck with "mod",
>> I see no reason to change it.
> Because mixing/combining a word (identifier) with a symbol, well for me: it
> hurts my eyes.

As I said, I agree, "a mod b" looks worse than "a % b",
but that was Wirth's decision, and the difference is so small
I do not think it is really an issue.

>> 2) Also, the actual use case was for TPoints,
>> and I have already overloaded operator div.
>> I think that the need to duplicate code and pollute
>> namespace with additional "DivAssign" procedure
>> did not improve the code readability at all
> You don't duplicate code:
> procedure Divide(var op1: TPoint; op2: TPoint);
> begin
>  op1 := op1 div op2; // using your overloaded operator.
> end;

Sure, sure, it is all not a big deal.
Still, this is an awkward workaround for, IMO,
a trivial and arbitrary limitation of the compiler.

Alexander S. Klenin

More information about the fpc-devel mailing list