[Lazarus] Forward declare (modern) records [was: Re: "global" operator overloading]

Hans-Peter Diettrich DrDiettrich1 at aol.com
Tue Feb 26 23:14:24 CET 2013


Sven Barth schrieb:

> He wants to have this supported:
> 
> === example begin ===
> 
> type
>   SomeType1 = record;
>   SomeType2 = record;
> 
>   SomeType1 = record
>     // ...
>     property SomeProperty: SomeType2 read ... write ...
>   end;
> 
>   SomeType2 = record
>     // ...
>     property SomeProperty: SomeType1 read ... write ...
>   end;
> 
> === example end ===

In the meantime I understand why such a construct *is* useful, in detail 
with records. The *caller* provides the memory for the result, returned 
by an property getter, and is responsible for releasing it. Not so with 
pointers, for which memory may have to be allocated, but there is no 
obligation to release that memory (no owner)!

DoDi





More information about the Lazarus mailing list