On 26.02.2013 16:15, ListMember wrote:

All three types, records, objects and classes have their purposes and
uses and one can select the one that is most fitting in a given
situation.

Is it possible to forward declare records the way we can with classes?

I mean, with classes, I can do this:

TSecondClass = class;

TFirstClass = Class(TObject)
private
   FSecondClass: TSecondClass;
public
end;

TSecondClass =  Class(TObject)
private
   FFirstClass: TFirstClass;
public
end;

but, I don't seem to be able to do the same with records --I am
referring to the new/modern records.

I can see why it isn't immediately available, but it would be so much
nicer if fpc handled the pointer stuff in the background.

It would be no use anyway. You CAN NOT have the record used as a field inside itself, so you'd need to define a pointer type anyway. And this is something where we won't do things behind the programmers back. If you need a pointer then you declare one.

Regards,
Sven


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to