Composition over inheritance: Difference between revisions

Content deleted Content added
Add Scala to the list of programming languages with features to mitigate drawbacks
Line 291:
* [[Raku (programming language)|Raku]] provides a {{code|handles}} keyword to facilitate method forwarding.
* [[Rust (programming language)|Rust]] provides traits with default implementations.
* [[Scala (programming language)|Scala]] (since version 3) provides an "export" clause to define aliases for selected members of an object.<ref>{{cite web | url=https://docs.scala-lang.org/scala3/reference/other-new-features/export.html | title=Export Clauses | website=Scala Documentation | access-date=2021-10-06}}</ref>
* [[Swift (programming language)|Swift]] extensions can be used to define a default implementation of a protocol on the protocol itself, rather than within an individual type's implementation.<ref>{{cite web | url=https://docs.swift.org/swift-book/LanguageGuide/Protocols.html | title=Protocols | website=The Swift Programming Language | publisher=Apple Inc | access-date=2018-07-11}}</ref>