Peter N Lewis wrote:
In this case, I don't think it should work. BP doesn't allow the above, though BP (and GPC as well) allow this:
I just try to get as much consistency as is possible within the bounds of the different syntax and facilities.
program Foo;
type MyObjectA = object f: procedure( var obj: MyObjectA ); end;
begin end.
And even this (GPC with the usual warning about value object parameters):
program Foo;
type MyObjectA = object f: procedure( obj: MyObjectA ); end;
begin end.
Neither of those would allow the case of ObjectA referencing ObjectB and vice versa though (it doesn't really come up in non-reference objects though because you have to have a pointer anyway, and so the normal "forward defined pointer types" trick works.
Indeed (and this was about this model, i.e. BP). For the other models, forward declaring object types/classes (even with different syntaxes, alas) seems to fill this gap.
Frank