[fpc-devel] strict private

Graeme Geldenhuys graemeg.lists at gmail.com
Sat Dec 6 08:30:12 CET 2008


Hi,

I ported some code (a Relationship Manager design pattern) that was
written in Delphi to Free Pascal.  I noticed that the original author
used 'strict private' in the class declarations - where one unit had
multiple classes.

I simply removed the 'strict' part and FPC was happy.  Is FPC going to
support the 'strict private' keywords?

I haven't read up on what exactly it means, but from the name, I would
guess that if you have multiple classes in a single unit and some code
is under 'strict private' section, that the other classes can't access
it? By default in FPC all code, even from different classes, in the
same unit can access anything in other classes (private, protected and
public). Is my assumption correct?  If so, this could be a handy
addition.

To achieve the same in Free Pascal, those classes will have to be
defined in separate units, which is not always ideal.


Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-devel mailing list