3 ms·
> If you want a package scoped standalone function, you don't need to invent some made up "class" to attach it to. It's a matter of language construct organiza
by friendzis 3y ago
> If you want a package scoped standalone function, you don't need to invent some made up "class" to attach it to.
It's a matter of language construct organization. There are bare behaviors - functions, there is bare state - PODs, and then there are collections of state and behavior - classes. You can have these three distinct constructs, or you can have all them be subcases of class (or some other mix).
It's just that we are used to having distinct primitive and collection data types, but nothing (sans terseness) stops language from having all data be some form of collection, even if it is a single-member collection.