[fpc-pascal] Traits Proposal

Benito van der Zander benito at benibela.de
Wed Feb 17 00:02:42 CET 2021


Hi,
>
> And there often is a lot of unintentional deep copying. This is also 
> why a property returning a record is fairly useless except for 
> extremely small records like TPoint (and even that is not optimal no 

But a managed record to replace an interface, would only contain a 
single pointer/class ref. That can be copied fast



Bye,
Benito
On 16.02.21 21:49, Marco van de Voort via fpc-pascal wrote:
>
> Op 2021-02-16 om 21:33 schreef Ryan Joseph via fpc-pascal:
>>
>>> On Feb 16, 2021, at 1:27 PM, Marco van de Voort via fpc-pascal 
>>> <fpc-pascal at lists.freepascal.org> wrote:
>>>
>>> And there often is a lot of unintentional deep copying. This is also 
>>> why a property returning a record is fairly useless except for 
>>> extremely small records like TPoint (and even that is not optimal no
>> deep copying? You mean from ref counted types like "array of" and 
>> ansistring?
>
> No, use of TP objects and records in e.g. properties in not carefully 
> crafted code. They are a lot less userfriendly.
>
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20210217/e38630d7/attachment.htm>


More information about the fpc-pascal mailing list