At 12:50 +0200 5/7/05, Frank Heckenbach wrote:
I imagine that would only work with non object reference if GPC was smart enough to know that the size was unknown and therefore it could only be used as parts of types where its size was not needed (eg ^MyObjectA). Whether that would be useful, I don't know, unless it could also cope with a case like:
What are non-object references? I only know var-parameters and in a sense, absolute-variables, both don't apply here.
Sorry, I was unclear, I meant objects that are not references (ie, the record style objects used by BP and GPC, as opposed to the reference/pointer style objects used by Delphi/Mac/and Waldek's new GPC patches.
But that would all be much harder than the case of class/reference object where the type size is known to match SizeOf(Ptr) even though the type is not defined fully yet, just like explicit forward pointer definitions.
Oh, you mean non-reference objects, I suppose.
Right.
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. Peter.