[fpc-pascal] Traits Proposal

Ryan Joseph genericptr at gmail.com
Wed Feb 17 02:15:47 CET 2021



> On Feb 16, 2021, at 2:43 PM, Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> 
> FPC currently does not yet support class types not to mention records and objects which is what I had mentioned earlier already.

Yes I see this on https://freepascal.org/docs-html/ref/refse47.html. Why isn't this supported? I guess as part of this proposal we need to implement this feature as well?  I'm not familiar with this area of the language so I'm not sure what this entails.

> 
>> It's a strange syntax compared to anything else we allow in classes and the boiler plate is really adding up now. "procedure Draw" is going to be in 4 lines now!
>> 
>> It would be nicer if they made this into one line so we don't have yet another set of duplicate method signatures, i.e.:
>> 
>>   procedure Draw as ICircle.Draw;
> 
> I can't shake the feeling that all you complain about is writing even a little bit too much. Pascal is *not* about using as less code as possible, but to be as correct as possible and the syntax of interface delegation allows exactly that.

Being too verbose is clunky in my opinion. That method resolution syntax is just kind of an odd addition for classes to my eyes. "procedure Type.Name = Name;" doesn't have any precedence inside classes/records so it stands out.

Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list