ExtensionMethods

From APIDesign

Jump to: navigation, search

A way to extend RootClass (or any other class) with functionality without disturbing others. Way better than DefaultMethods. Used in Kotlin. And also in Enso.

The basic idea is to avoid extending RootClass physically, but rather extend it virtually via a lexical compilation scope.

See wikipedia:Extension_method explanation which may agree or contradict my view.

Personal tools
buy