Good Morning!
Happy Monday! 🙂
morning
👋
morning
¡måning!
Well today I learnt something new. You can redefine a defmethod
. I always thought you couldn't as I understood multimethods were cached and un-redefinable.
But, if I understand now, it's the dispatch function that cannot be changed. However, I see there is a little trick to use a reference to a function which does the dispatching, wihthin the defmulti
You can redefine them if you use clojure.tools.namespace’s refresh / clear etc.
Also you can also do so manually by just (def mymulti nil)
then re-eval the defmulti and defmethods you want.
Also remove-method
and remove-all-methods
Morning 👋
you can blat the defmulti
and redeclare it
but you cannot just redeclare overwrite it because there is a defonce
squirreled away inside, and it will just ignore you
thank you 🙂
thank you 🙂