Hacker News new | ask | show | jobs
by lorddoig 2852 days ago
Crucially they don't carry around mutable state by default. If you want a record with protocols to act like a stateful object you can do it, but you have to explicitly jump through hoops eg by embedding an atom in one of its fields and writing all your own getters/setters. It's not an especially pleasant or useful way to write Clojure(Script) but, as others have mentioned, it can be useful for things like achieving very high performance in certain situations.
1 comments

Sure, they're immutable, but it's still very much OO. I've never heard of OO requiring mutable state.