I consider myself neither a genius nor stupid. Somewhere in between my mind and determination have allowed me great freedom in learning new things. It comes about from a combination of Thomas Edison’s 99% perspiration along with some decent gray matter.
Learning Clojure has not been a cake walk — even though I enjoy using the cake build system — and I did not want it to be a snap. Of all the things to learn, accumulating final results using reduce, knowing when to use recursion, and so on, the most difficult thing for me to learn are multi-methods, the use of defmulti and defmethod.
I have most of the Clojure books. All of them are different offering a different approach to the language; and all of them are in my opinion well written. This topic remains elusive, but this post on Pure Danger is a start in the right direction, and it does show what I have suspected all along. The following is my non-official description of multi-methods, not an official language description.
You must construct the defmethods and the defmulti dispatch function and your input data in such a way that the parameter data becomes, in effect — tagged — with the dispatchable value. If this is wrong, it can be noted if anyone wants to comment. I don’t know why this has me stumped. I’ve gotten a lot of other concepts, but this one has me thrown out of orbit.