> > 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.
How do you find the code that overloaded an operator?

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to