[fpc-pascal] Implementing a true Singleton - Can we decrease the visibility of a method?

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Dec 8 14:03:05 CET 2006

On 12/8/06, Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:
> Quote:
> "You should not change the access modifier for inherited members."
> So it's possible but discouraged, and they give warnings (and
> sometimes errors) for it with the recommendation "Do not exclude a
> warning from this rule."

There is a lot of things in life we shouldn't do, but we do.  :-)
At least give us the choice, maybe via a compiler directive and keep
the compiler warning in place.  That way we can use it responsibly
when required, as in the case of implementing a true singleton. I'm
sure there are more examples. As it stands currently (my sample
singleton code) the developer can still screw up by creating a new
instance instead of going through the global function.

Graeme Geldenhuys

There's no place like S34° 03.168'  E018° 49.342'

More information about the fpc-pascal mailing list