[fpc-pascal] mixin feature

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Dec 24 10:12:23 CET 2009

On 24 Dec 2009, at 05:27, Bee Jay wrote:

> I'm now studying Qooxdoo (JS framework) to make ExtPascal-like tool based on it. Qooxdoo's OO implementation has mixin feature (http://en.wikipedia.org/wiki/Mixin). Since this feature is not provided by object pascal language, I have trouble writing the library wrapper. For the first step, maybe I just could skip the feature. But this would prevent custom widget creation of Qooxdoo from pascal. Somehow, I'm curious about it since QWT (qooxdoo for GWT) is able to provide mixin in Java which also doesn't support mixin. So I think there must be a way to implement it in Pascal as well.

From the wikipedia page you linked above: "Interfaces combined with aspect-oriented programming can produce full fledged mixins in languages that support such features, such as C# or Java."

I'm not aware of any existing AOP framework for Pascal.

> Can someone tell me how to implement "fake" mixin feature in pascal?

I think the regular way to do this in Object Pascal is via implements-style delegation (which doesn't really fake mixins; I think it provides exactly the same functionality, just using a slightly different concept). I don't think that's already fully functional in FPC, but Florian and Sergei (Gorelkin) have recently improved it quite a bit.


More information about the fpc-pascal mailing list