The differences between OOP and multimethods should be stressed. I just wrote about this on my blog, and those who mostly worked with OOP kept wondering, how do you get inheritance of functionality? Actually, they did not ask this clearly, so it took me awhile to understand their question, and then explain that you can simulate something like the inheritance of an interface, but not functionality. I also said that keyword inheritance and polymorphism could be combined to deliver a simulation of OOP style inheritance of functionality. But folks coming from the OOP world tend to hear the word "inheritance" and think there is a way to inherit functionality, and that is not really true.
It's sort of an advanced subject, but you can store keywords (belonging to some hierarchy) in the :tags metadata on the var and then match against that with multimethds, and simulate something close to the OOP style, but that leads into the question of why it might be a bad idea to try to imitate every OOP idea in Clojure. There are some questions on Stackoverflow where people ask "How do I get inheritance of functionality in Clojure?" On Sunday, October 26, 2014 11:48:29 AM UTC-4, Daniel Higginbotham wrote: > > What's difficult when it comes to understanding multimethods, records, > types, and protocols? I'm writing a chapter on multimethods, records, > types, and protocols for the book Clojure for the Brave and True, and I'd > love to hear about what kinds of pitfalls I should be sure to cover :) > > Thanks! > Daniel > > > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.