This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-17
Channels
- # adventofcode (2)
- # beginners (153)
- # cider (14)
- # clara (9)
- # cljs-dev (8)
- # cljsjs (1)
- # cljsrn (4)
- # clojure (124)
- # clojure-dev (9)
- # clojure-france (18)
- # clojure-greece (22)
- # clojure-italy (11)
- # clojure-nlp (5)
- # clojure-russia (9)
- # clojure-spec (21)
- # clojure-uk (40)
- # clojurescript (82)
- # core-async (12)
- # cursive (3)
- # data-science (2)
- # datomic (225)
- # devcards (8)
- # docs (2)
- # duct (1)
- # emacs (18)
- # figwheel (2)
- # fulcro (117)
- # graphql (13)
- # hoplon (10)
- # jobs (7)
- # jobs-discuss (7)
- # keechma (8)
- # leiningen (4)
- # off-topic (16)
- # om (2)
- # om-next (3)
- # perun (11)
- # precept (4)
- # re-frame (24)
- # reagent (2)
- # remote-jobs (8)
- # ring (2)
- # ring-swagger (9)
- # rum (42)
- # shadow-cljs (8)
- # spacemacs (3)
- # specter (7)
- # uncomplicate (10)
- # unrepl (58)
- # yada (9)
måning
Morning
@rickmoynihan - Thanks for your “further thoughts” yesterday - I had stepped away from the machine for the evening, and I’ve been on conference calls this morning, but this ^^ is all very helpful, so thanks 🙂
thx @dominicm 🙂
@maleghast yeah, the one from http://autonomous.ai
I think we all do 😉
I just got the email about Datomic Cloud from Cognitect - anyone else had a look..? Thoughts..?
it was announced at the conj so not a big news, but awesome to finally see it available
@bronsa - Oops! I missed the announcement; got all excited that this was new news! Oh well… That aside, looking at the blogpost about it and the other info it looks very cool / good for new apps just starting out with a need for Datomic. I am trying to find a cost comparison…
https://www.youtube.com/watch?v=Ljvhjei3tWU for the conj talk
I have no idea how to use that calculator
Curiosity getting the better of me... How often do you find yourselves using defmulti
and defmethod
?
We have 13 defmulti
in 9 files -- in a codebase of around 75,000 lines.
And 19 defprotocol
in 10 files.
Safe to say it's not a very common thing compared to other code in the language then?
I've seen it used in a coupe of libraries, but rather far and few between
@seancorfield Would you say there are clear clues as to when you would want to use defmulti
?
(and 144 defmethod
in 11 files, just for completeness)
Is the main purpose for hierarchical stuff?
I think it depends on the domain... we don't have all that many things that are inherently polymorphic.
Some of our search code uses it (polymorphic on the "type" of search -- we have about six different "shapes" of search), a little bit of our payment logic (polymorphic on the payment provider), some email event handling (polymorphic on the event -- delivered, bounced, etc).
I think if we were rewriting some of our core member handling logic, we'd make that polymorphic on the "category" of member (we have roughly three categories but mostly only distinguish between two of those).
Cool, thanks for the explanation 🙂
27 defmulti
s, weirdly also 144 defmethod
s, and 126 defprotocol
s in 100kloc here @yogidevbear
we use defmulti
a bit in the re-frame UI but the main use that springs to mind is in our message routing - different aspects of the routing get defmethod
s and particular message types combine those aspects
Awesome, thanks for the extra feedback 🙂
I think part of this is that Clojure is inherently a lot more generic so the heavy polymorphism you see in Java et al just isn't necessary... the old Perlis quote comes to mind...