3 ms·
I will take a stab at it. > Functors are basically an Object with a internal state changing method in typical OOP terms. If I was writing a functional languag
by davorak 6y ago
I will take a stab at it.
> Functors are basically an Object with a internal state changing method in typical OOP terms.
If I was writing a functional language, in an oop language, I could implement functors at least partially with an Object with an internal state changing method. I could not model/implement an Object with an internal state changing method in a fp language via a functor.
The main issue with the author's statement is that it makes a claim of approximate equivalence and does not back it up with additional evidence or examples.
- newswasboring 6y ago> I could not model/implement an Object with an internal state changing method in a fp language via a functor. I don't think anyone claimed that. > I could implement functors at least partially with an Object with an internal state changing method. Now we are getting somewhere. You said partially, what features are being left out?
- davorak 6y ago>> I could not model/implement an Object with an internal state changing method in a fp language via a functor. > I don't think anyone claimed that. I was not trying to refute the opposite claim. I was giving info on the differences of functors and the referenced oop feature. My points run somewhat counter to the authors claim "Functors are basically an Object with a internal state changing method in typical OOP terms." or at least what I think some reads walk away with. Hard to say what is in the author's head with the provided text. > Now we are getting somewhere. You said partially, what features are being left out? I did not mean to imply features would be left out but rather I would use more than the one oop feature, "an Object with an internal state changing method", to implement functors.
- newswasboring 6y ago> I did not mean to imply features would be left out but rather I would use more than the one oop feature Awesome, we are still getting somewhere. What other oop feature would you be using
- davorak 6y ago> Awesome, we are still getting somewhere. What other oop feature would you be using I'm glad you think it was productive so far. I am not convinced it is a productive use of our time to continue/extend the thought exercise though.