clojure-uk

A place for people in the UK, near the UK, visiting the UK, planning to visit the UK or just vaguely interested to randomly chat about things (often vi and emacs, occasionally clojure). More general the #ldnclj
dharrigan 2020-09-07T06:12:00.183300Z

Good Morning!

seancorfield 2020-09-07T06:44:08.183500Z

Happy Monday! 🙂

alexlynham 2020-09-07T07:07:18.183600Z

morning

djm 2020-09-07T07:08:12.183800Z

👋

thomas 2020-09-07T08:32:13.184Z

morning

mccraigmccraig 2020-09-07T08:38:09.184200Z

¡måning!

dharrigan 2020-09-07T09:25:52.185600Z

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.

dharrigan 2020-09-07T09:27:00.186800Z

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

2020-09-07T10:16:11.187200Z

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

Jakob Durstberger 2020-09-07T14:14:58.187500Z

Morning 👋

2020-09-07T14:39:38.187700Z

you can blat the defmulti and redeclare it

2020-09-07T14:40:20.187900Z

but you cannot just redeclare overwrite it because there is a defonce squirreled away inside, and it will just ignore you

dharrigan 2020-09-07T16:51:40.188300Z

thank you 🙂

dharrigan 2020-09-07T16:51:45.188500Z

thank you 🙂