Challenge: solve this multiple inheritance problem in your favorite language

IGotD- nise at nise.com
Mon Sep 28 22:50:14 UTC 2020


On Friday, 5 June 2020 at 06:40:06 UTC, Jacob Carlborg wrote:
>
> It's already possible to do that today:
>
> class Person : NameI, AddrI {
>   mixin NameT!Person Name;
>   mixin AddrT!Person Addr;
>
>   bool equals(Person other) {
>     return Name.equals(other) &&
>            Addr.equals(other);
>   }
> }

That was important information for as it means that some symbols 
collisions can be avoided. I didn't know that mixins had a scope. 
This makes the mixin templates more useful.


More information about the Digitalmars-d mailing list