[fpc-devel] Circular references and forward declarations

Graeme Geldenhuys graemeg.lists at gmail.com
Tue Jan 5 23:40:22 CET 2010


On 05/01/2010, Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:
> two different units can both declare a different class with the same name
> (just like they can both have global variables and procedures/functions

And I would bitch-slap any developer in my team that tries that!

>  b) add some way to specify the unit name in which this external class is
> specified, or

Delphi's project file already does this (kind of). The uses clause
mentions the unit and the location of that unit.


I must say, I agree with the original poster - it would be very
useful. I have had many battles to try and overcome circular reference
issues, and I do take care in my class designs. Sometimes there are
truly valid designs where x-referencing is needed, and then I have to
find some work-around due to the Object Pascal language - which
normally ends up with lots of type casts in the implementation
section, or bunching classes in a single unit.

Don't ask me for an example, I can't think of one now, but it happened
a few times in our current work project.


-- 
Regards,
  - Graeme -


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



More information about the fpc-devel mailing list