If I write a function like:
f(x) = x + 2
would you say the value of x is "hidden" in the expression x + 2? I would say no: it's clear that there is a value of x at the point where we evaluate that expression. That's a different kind of thing from the OO style where we write o.f() and genuinely can't distinguish whether there is relevant internal state in o (and whether that state is mutated by the call to f()), or not.In the composition of functions, f . g (x) = f(g(x)), that there is a result of g(x) is hidden by the composition, which only allows examination of the first input and the final output.
There is nothing special about OOP here.
It's hiding the differing constructions, but at that point I don't see that as a true difference. (\x . x + 2) . (\x . x + 2) seems to me to be the same value as \x . x + 4 in exactly the same way that 2 + 2 is the same value as 4.
> In the composition of functions, f . g (x) = f(g(x)), that there is a result of g(x) is hidden by the composition, which only allows examination of the first input and the final output.
> There is nothing special about OOP here.
Having mutable state hidden/encapsulated with a bundle of functions that may be entangled with that state is unique to OOP; as I said in the side thread, hidden structure is not the same as hidden state.
When you reason about something as a group, that reasoning operates with the details hidden. When you apply that abstract reasoning to a concrete problem, of course that information is still there. Abstraction is a boundary that looks different on either side. In a similar vein of your example, the compiler knows all the information you're hiding through your program abstractions, but from the point of view of pieces of your code, that abstraction has hidden something.
> What's the difference? If you don't mean the normal kind of abstraction then what's the definition of the thing that you're talking about?
The word abstraction is so... abstract that it isn't actually a uniform concept applied in different areas but instead many similar concepts that look the same if you squint.
The concept I'm talking about is abstraction in the context of program structure. This is more related to mathematical abstraction than a mere metaphor but it's not exactly the same thing as the abstraction in a definition like groups, nor is it the same abstract as in abstract art.