D vs. C#

Julio César Carrascal Urquijo jcesar at phreaker.net
Fri Nov 24 11:42:02 PST 2006


Hasan Aljudy wrote:
> Actually, I think you can achieve the same effect in D using mixins.
> 
> --------------
> template CodeGenerator_Class_Part()
> {
>     //declarations ...
> }
> --------------
> template Class_Coder_Part()
> {
>     //declarations
> }
> --------------
> class Class
> {
>     mixin CodeFenerator_Class_Part!();
>     mixin Class_Coder_Part!();
> }
> --------------
> 
> I think each of these can be in a separate file.

Not quite. Methods aren't imported from the mixin and don't participate 
in function overloading unless they are explicitly aliased, if I 
remember correctly.



More information about the Digitalmars-d mailing list