On Monday 19 October 2009 10:47:40 Peter Popov wrote: > > All features being equal, I would rather have class constants and class > > types > > included in FPC. > > Class constants are exceptionally bad idea: I've seen a guy define > PI=3.1415... inside a C++ class! The same functionality already exists in > fpc: define a (class, inline) function returning the constant value. Then, > if you are a moron, you will have to write a lot of code to do a senseless > thing, otherwise possibilities for abuse multiply exponentially :-)
The implementation I'm talking about that would have a constant PI=3.1415 within say MyClass would only work if called as MyClass.PI In your example, the global PI would always be defined unless somebody redifines it, and then it's not a class constant anyway. if OOP is about data encapsulation, why are we using global constants and types? Nino _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel