[fpc-devel] class constants
"Vinzent Höfler"
JeLlyFish.software at gmx.net
Mon Oct 19 13:59:06 CEST 2009
"Peter Popov" <ppopov99 at gmail.com>:
> PI exists, it has a unique transcedental value, so it should clearly be
> global. Semanticaly, MyClass1.PI and MyClass2.PI are different
> identifiers, which given the nature of PI is a ridiculous concept.
The unique transcendental value of PI can not be expressed within a finite computing machine.
So in fact, there may be more than one approximation, i.e. one for single-precision, one for double-precision.
> That is my point: most constants are global in nature. It would be
> interested to see a class constant which is usefull where a global
> constant (within a unit) is not.
If the constant is used within the class and in descendants only, it might. I'm a strong believer of reduced visibility.
Of course, as you state, the visibility provided by the unit might be enough. But it also means, that a derived class may need to include that unit whereas in case of a class constant, it wouldn't need to. Not that this is a particularly strong argument. ;)
Vinzent.
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
More information about the fpc-devel
mailing list