[fpc-devel] Type definition

Michael Van Canneyt michael at freepascal.org
Sat Mar 4 21:44:52 CET 2006



On Sat, 4 Mar 2006, Peter Vreman wrote:

> > If there compelling reason why type definitions cannot be included in
> > class/object definitions?
> > Make it mode FPC to keep folks happy :)
> >
> > Quite often a type is defined in INTERFACE part, but only used within
> > class/object defined in same unit.
> > 1)  This means that type is public.  This is not always good thing in
> > OOese.
> > 2)  Unit must be specified in child's child's USE list.
>
> It breaks code and is therefor incompatible. A type symbol is never
> searched in an object, class or record symtable.

At the most we could introduce a 'Private' type section in the unit
interface section.

But even that is not needed, as you can perfectly solve the problems
without it, just use a class factory and inheritance.

Michael.



More information about the fpc-devel mailing list