[Lazarus] Circular references

Michael Van Canneyt michael at freepascal.org
Fri Aug 14 09:32:40 CEST 2009



On Fri, 14 Aug 2009, Graeme Geldenhuys wrote:

> Michael Van Canneyt wrote:
>> 
>> This is the world upside down.
>
> So why is forward declarations allowed? It's the same principle!

No, because the declaration is guaranteed to follow in the same unit.
A unit forms a self-contained whole.

Unit loading is a difficult matter as it is. If you start spreading 
declaration and implementation over different units, I'm not sure that
the compiler can guarantee correctness.

But Florian should answer this, he is more knowledgeable about the
compiler internals.

Michael.




More information about the Lazarus mailing list