[fpc-pascal] A better way?

Ryan Joseph ryan at thealchemistguild.com
Fri Apr 15 11:08:27 CEST 2016

> On Apr 15, 2016, at 3:56 PM, Sven Barth <pascaldragon at googlemail.com> wrote:
> *shudders* Before we introduce such syntax I'd prefer to get the formal class types that were added for Objective Pascal working with Object Pascal as well (which would be exactly what you want just with a more sane syntax).

I agree 100%. Putting a class definition into the namespace of another unit and importing like Objective Pascal(c) does is preferable. There doesn’t seem to be much interest in the problem though.

> But again: you're currently fighting against the language. Use interfaces and abstract classes and overthink your dependencies and design. 

Thanks to better usage of “uses” in the implementation I’ve learned now how to replace the abstract classes with weakly typed parameters and typecasting which is perhaps a small improvement because I don’t need to worry about extra classes and overriding etc… I’m happy with that but I’m still doing something the compiler could be helping with so I thought I’d mention it in the spirit of efficiency. :)

The only question now is if using $ifdef’s and $includes to make large single units is preferable to typecasting ugliness.


	Ryan Joseph

More information about the fpc-pascal mailing list