"The last feature": overridable methods in interfaces

Michel Fortin michel.fortin at michelf.com
Mon Feb 8 10:32:57 PST 2010


On 2010-02-08 13:04:37 -0500, retard <re at tard.com.invalid> said:

> No, I don't know the original source. Multiple inheritance is an old and
> widely known problem. I just meant that instead of bikeshedding here and
> reinventing everything from scratch, everyone interested in the topic
> should take a look at Scala's traits since traits basically are
> interfaces extended with function bodies. Scala also has a solution to
> the conflicting multiply inherited methods. I just mentioned Scala
> because it's also a C inspired object oriented language and this feature
> proposal is more or less 90% the same concept as traits, both
> syntactically and semantically.

>From what I can read, traits in Scala are much than adding function 
definitions. You can add member variables and inherit from a base 
class. It acts much like an interface + a mixin. It's quite nice really.

<http://www.codecommit.com/blog/scala/scala-for-java-refugees-part-5>


-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/




More information about the Digitalmars-d mailing list