2 ms·
Since I'm getting downvoted: Folks, this is Chapter 3 of Structure and Interpretation of Computer Programming. Technically you don't even need a struct; closur
by skybrian 9y ago
Since I'm getting downvoted:
Folks, this is Chapter 3 of Structure and Interpretation of Computer Programming. Technically you don't even need a struct; closures and mutability will do.
And how do you serialize data that function pointers in it?
- HumanDrivenDev 9y agoI am almost positive Rich Hickey hasn't read that book. The only thing more stunning than his ignorance when he talks about OO is the amount of young programmers who believe everything he says. It blew my mind when I realised I could write objects from scratch in languages with closures, even statically typed ones! Of course each object has its own v-table in the SICP code, so probably not something you should use in production.
- pjmlp 9y agoI always find ironic when such young devs bash OOP, given that Clojure has protocols and multi-methods. Or bashing Java and the JVM, without which Clojure would not exist in first place.
- coldtea 9y agoYou're not downvoted because people ignore that fact. You are downvoted because people disagree that it's important. Yes, you can create objects with closures, but when people talk against OO programming, they mean the paradigm, not merely the possibility that a language can do objects. Forth and C can do object oriented programming just fine too, if one is so inclined.