[fpc-pascal] Re: operator overloading and counting references / creating / destoying anonymous instances
Florian Klaempfl
florian at freepascal.org
Sat Jul 30 17:58:31 CEST 2011
Am 30.07.2011 17:05, schrieb Jürgen Hestermann:
>> > Say for instance you are working on Galois fields and you have to do
> arithmetic on the elements like this:
>> > g1 + g2 / g3
>> > If you don't have operator overloading, you have to do it with
> functions, like this:
>> > gf_add(g1, gf_div(g2, g3))
>> > This is not very readable, I'm sure you will agree.
>> No, I don't agree at all. The procedure call clearly shows me that a
> complex calculation
>> is done instead of an (atomic) add and division command on numbers.
>
>
> And there is another advantage of using procedures/functions instead of
> overloading operators:
> You can search for the procedure to look what it actualy does.
Not if you use function/procedure overloading. Then the situation is
exactly the same as for operators.
> How do you find the code that overloaded an operator?
More information about the fpc-pascal
mailing list