[fpc-devel] Circular references and forward declarations

Horacio Jamilis hjamilis at pymesoft.com.ar
Tue Jan 5 18:48:39 CET 2010

El 05/01/2010 13:07, Juha Manninen escribió:
> Why is it not allowed from another unit? They are conceptually the same thing!
> The problem could be solved easily if there was a forward declaration saying:
>    TMyClass = class; defined in "MyUnit.pas"

I need this feature too, and I like this proposed syntax.

In my case, my classes are defined in a form unit, so I can not have 
more than 1 class per file (this is a Lazarus project)...
I know that I should have more divided the visible editing and the class 
itself, and I did, with some tricks, but I continue with the 1 file per 
class implementation.
so the idea to have 1 big file is not possible ... and if it where, i 
will not like it anyway.
When I asked for this possibility, I was told to create one big unit 
with abstract classes definitions... that may help me, but never had the 
time to test it...
I am casting everywhere... It´s ugly and error prone, but is what works.

So this feature could make my life a lot easier ... but I don´t know how 
to implement it... else I would do it.

It is with no doubt in my wish list.

Good luck on this


More information about the fpc-devel mailing list