Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on "Study Functional Programming or Be Ignorant". Parent comment
For instance, in Clojure I could write a multimethod that updates refs of type Student, and Course:
(defmethod assign [Student Course] [student course] (alter student update-in [:courses] conj course) (alter course update-in [:students] conj student))
So to rephrase my question: what are the advantages of OOP when dealing with mutable state?
There are no comments on this comment yet.
For instance, in Clojure I could write a multimethod that updates refs of type Student, and Course:
There is polymorphism and mutability here, but we're not dealing with objects.So to rephrase my question: what are the advantages of OOP when dealing with mutable state?