What facilities does GPC have for forward defining types.
In CW Pascal, I have some code that looks like this:
type MyProc = procedure( browser: MyObjectA ); MyObjectA = object f: MyProc; b: MyObjectB; procedure Doit( proc: MyProc ); function GetB: MyObjectB; end; MyObjectB = object; f: MyObjectA; // other references to ObjectA end;
Keep in mind all the "used before defined" types are pointer types (objects being implicitly pointers) and defined in the same "type" block.
GPC is not happy with this. Needless to say, given the dual referential nature of the references, it is hard to see how I can cleanly untangle this.
Is there any support in GPC or EP for these kinds of forward defined types? Any suggestions how I can untangle them within GPC?
The best I can see is to turn all of them into explicit pointers and explicit dereferences, which is doable, but rather ugly.
Any suggestions?
Thanks, Peter.