New concept Mixin Methods
Paul Backus
snarwin at gmail.com
Sun Dec 25 18:10:46 UTC 2022
On Sunday, 25 December 2022 at 18:02:54 UTC, Andre Pany wrote:
>
> Thanks all for the valuable feedback.
>
> Yes, the essence of the idea is to make the usage of frameworks
> as simple as in other languages (e.g. Delphi, Java). Just by
> inheriting from a class, everything "just works".
> In languages with runtime introspection capabilities this is
> easy. In D here is a small gap, in addition to inheritance you
> need to mixin the template in every class.
>
> Yes, it is syntax sugar, but also avoids the issue that users
> forgets the mixin template statement.
You may find some inspiration in Herb Sutter's proposal for
metaclasses in C++:
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0707r4.pdf
More information about the Digitalmars-d
mailing list