▲ | geokon 3 days ago | ||||||||||||||||||||||||||||||||||||||||
??? I don't understand. Did you not read my comment? I just explained how your seemlessly extend records across library boundaries. It's not just solving with interfaces | |||||||||||||||||||||||||||||||||||||||||
▲ | roenxi 3 days ago | parent [-] | ||||||||||||||||||||||||||||||||||||||||
I don't agree with your characterisation of what the magic of protocols is. A protocol is the lightest possible thing that captures how two things can interface. That is magic in a way, but it is also the end of it, Clojure does a masterful job of keeping concepts tidy. In terms of what you can do with protocols, you can indeed do that in many languages. Clojure is pretty smooth but there is nothing stopping anyone implementing any interface on any object in most languages; build some sort of adapting whatever. It is rare enough in practice that the extra dev work isn't a major problem. And as a bonus observation, any time your example of how to use a programming feature involves animals it is a fake use case. It is a bad sign because it suggests that the benefit doesn't have a real world use. | |||||||||||||||||||||||||||||||||||||||||
|