But in any case, parent's comment that "OOP has no special claim" to hidden state/data (or abstraction) is sound; after all, ADTs already do that.
But in any case, parent's comment that "OOP has no special claim" to hidden state/data (or abstraction) is sound; after all, ADTs already do that.
I'd disagree with even that much; I'd say abstraction is much more about parameterisation - factoring out the common structure from different constructions - than outright hiding anything.
> But in any case, parent's comment that "OOP has no special claim" to hidden state/data (or abstraction) is sound; after all, ADTs already do that.
ADTs don't hide mutable state. That much is something OO has a special claim to.
This is particularly true of software, but I'd argue it's also true of basically every branch of mathematics outside of a few particular sub-fields of algebra (which are either extremely simple or extremely abstract, and often both).
> ADTs don't hide mutable state. That much is something OO has a special claim to.
How so? Abstract datatypes certainly hide mutable state. Just because a language doesn't have the "private" keyword doesn't mean that internal data can't be excluded from the interface... this was done all the time in e.g. C without the message passing semantics that characterize OO languages.
Maybe if you can mutate it, but having it be visible isn't an issue.
> Abstract datatypes certainly hide mutable state.
ADTs are normally understood to be values i.e. immutable. Hidden structure is not the same thing as hidden state.