3 ms·
I don't understand your reasoning. What does prevent you from having hidden state within a first-class module? It's simply encapsulation at module level.
by sedatk 6y ago
I don't understand your reasoning. What does prevent you from having hidden state within a first-class module? It's simply encapsulation at module level.
- willtim 6y agoObjects don't have to have mutable state. And even if they do, it can be unobservable. This is true "state encapsulation" but the OOP definition of encapsulation does not require this. Such objects are still very useful as "first-class modules", i.e. modules that can be passed around and switched at runtime.