They are actually different. The declaration of the inner class in your first example actually refers to SomeClass eigenclass. Eigenclass allows you to define instance-specific behavior for your classes. Therefore, the somefunction method does not actually belong to the class, but refers to instances of the class.
Regarding the use of this method, I could consider it useful if you want to expand the capabilities of an existing class without polluting its method namespace.
source
share