[fpc-pascal] Traits Proposal

Michael Van Canneyt michael at freepascal.org
Sun Feb 14 18:02:20 CET 2021



On Sun, 14 Feb 2021, Sven Barth via fpc-pascal wrote:

> Am 14.02.2021 um 13:30 schrieb Michael Van Canneyt via fpc-pascal:
>>
>>
>> On Sun, 14 Feb 2021, Sven Barth via fpc-pascal wrote:
>>
>>>> So whether it be this, or just an improvement on the Interfaces we 
>>>> already have, I'd definitely personally be in favor of something 
>>>> that "works like Interfaces except minus the negative performance 
>>>> implications."
>>>
>>> There are no significant performance implications of interfaces. 
>>> They're essentially a virtual method call, something that one is 
>>> doing all day long with Object Pascal classes.
>>
>> I think the "performance implications" is more referring to memory 
>> management.
>>
>> Interfaces means an extra object per interface, so more objects on the 
>> heap with all the extra memory management that implies.
>
> No, interfaces by *themselves* don't mean that.

I meant in the context of traits and mixins, obviously.

Michael.


More information about the fpc-pascal mailing list