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

TOndrej tondrej at gmail.com
Fri Dec 8 11:23:22 CET 2006


On 12/8/06, Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:
> I still don't know why we can't decrease visibility in Free Pascal.
> Is there some internal language design that prevents it?

A class definition (or at least its parts visible from outside) can be
understood as a kind of contract. If you have a class TDog with a
public property Tail then, by definition, any TDog descendant
(TBulldog, TLabrador, TDingo etc.) must have the public property Tail.
Otherwise they wouldn't be TDog but something else, again by
definition.

I'm not even sure if there is a language which allows demoting
visibility of inherited class members. It would seem odd to me. Just
my 2c, of course. ;-)

HTH
TOndrej



More information about the fpc-pascal mailing list