[fpc-devel] circular uses clauses

Joao Morais post at joaomorais.com.br
Fri Oct 3 02:31:41 CEST 2008


Graeme Geldenhuys wrote:
> Hi.
> 
> Quote from CodeGear news
> "circular uses clauses - why can't I declare two classes in two units
> that refer to each other? Why doesn't forward declarations cope with
> this? I've got this feature in C, C++ and C# why not Delphi?"

Because a Pascal compiler parses the interface section of an unit only 
once, ...

> That's a good question... Why can't FPC allow that either?  I don't
> know the internals of FPC, but can't FPC simply keep a list of used
> units as it compiles, so it simply skips any later references. What is
> the technical issue?  I'm just curious here.

... and the interface section of an unit need to be parsed before used 
by another one?

> Regards,
>   - Graeme -

--
Joao Morais



More information about the fpc-devel mailing list