Am 27.02.2013 13:22 schrieb "ListMember" <[email protected]>:
> Referring to your other post, you gave this example:
>
>
> === 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 ===
>
> While it does capture the idea, let me make it more detailed/clearer.

To be honest: I left out the methods, because of lazyness :)

> I only (wish to) use the forward declared record types in
methods/getters/setters/properties.
>
> Correct me if I am wrong, but this way we can eliminate the possiblity of
introducing infinite recursion (that would arise if we used forward
declared record types as fields).
>
> Is there still any logical flaw in this?

After having slept about it a bit, I came to the conclusion that your
proposal is at least a valid one considering that we already differentiate
between record field or not for the type itself. As a forward declaration
needs to be resolved in the same type section we don't need to bother about
global variable or function declarations either. What could be a bit
counterintuitive though is if there is a class, interface or object
declaration inbetween and that one uses the record as well... Depending on
when the sizes of the instances and parameters are calculated, we can
either allow or need to forbid its usage...

You can create a feature request on the bugtracker. I don't know yet
whether we'll definitely implement it or not, but this way it's up for
discussion. And please state there again that you don't want to use it for
fields.

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

Reply via email to