[fpc-pascal] Traits Proposal

Michael Van Canneyt michael at freepascal.org
Wed Feb 10 17:06:46 CET 2021



On Wed, 10 Feb 2021, Ryan Joseph via fpc-pascal wrote:

>
>
>> On Feb 10, 2021, at 8:41 AM, Michael Van Canneyt <michael at freepascal.org> wrote:
>> 
>> I heavily object to this; We have way too much keywords as it is already. So unless there really is no other way I don't think we should introduce
>> even more.
>
> I guess the first question is whether a "trait" is a new construct or just
> a way to import fields/methods from a  class.  I like the idea of a formal
> new type so we can limit the scope of the feature instead of taking on the
> baggage of an old type like "object".  I'll wait to hear from the compiler
> team however.

I don't see what baggage there is ?

You said it yourself: internally it will just be an object. Just make it formally so.

I also think the argument of reusing existing objects deserves consideration.

Michael.


More information about the fpc-pascal mailing list