Stroustrup describes a relevant example, applicable across most object oriented programming languages, in this interview: The C++ Style Sweet Spot: Designing Simple Interfaces.Originally Posted by MK27
If you want further elaboration:
How Non-Member Functions Improve Encapsulation
But the code examples are in C++ only.
It is not about circumventing any model. Rather, it is about providing a minimal yet complete interface, and then providing auxiliary modules that extend this interface. In such cases, neither composition nor inheritance is ideal, but functions and static methods (e.g., of an auxiliary class with no non-static members) fit the bill.Originally Posted by MK27
But if we are only designing a scripting language for a build system, these kind of design considerations might not be so important... or maybe they still are important.