[Lazarus] Circular references
Graeme Geldenhuys
graemeg at opensoft.homeip.net
Fri Aug 14 08:39:55 CEST 2009
Lance Collins wrote:
> Sorry if this is the wrong place to discuss language issues.
Probably the fpc-dev mailing list.
>
>> How can you avoid circular references with two modules that
>> interact with each other?
[...snip...]
>
> This feature is often needed and the "if you need to do that then
> something is wrong with your design" argument doesn't fly with me.
I can't agree more. Sometimes there is a valid design for something like
that. The compilers already handle forward declarations in the same
unit, so why can that not be applied for multiple units as well. And if
the forward declaration is not fully resolved by the time the whole
project or unit is compiled - raise a compiler error.
The current usage of forward declaration is exactly the same principle
we are trying to use, but this time just across units.
Regards,
- Graeme -
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/
More information about the Lazarus
mailing list