This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-23
Channels
- # aleph (8)
- # aws (2)
- # beginners (36)
- # cider (35)
- # cljs-dev (157)
- # cljsjs (3)
- # cljsrn (5)
- # clojure (97)
- # clojure-dev (5)
- # clojure-gamedev (3)
- # clojure-italy (27)
- # clojure-russia (11)
- # clojure-spec (19)
- # clojure-uk (39)
- # clojured (6)
- # clojurescript (87)
- # clojutre (4)
- # community-development (35)
- # cursive (8)
- # datascript (2)
- # datomic (14)
- # dirac (8)
- # duct (3)
- # figwheel (13)
- # fulcro (22)
- # graphql (20)
- # jobs (1)
- # london-clojurians (1)
- # off-topic (55)
- # onyx (3)
- # parinfer (3)
- # protorepl (39)
- # re-frame (3)
- # reagent (26)
- # ring (7)
- # ring-swagger (2)
- # rum (1)
- # shadow-cljs (107)
- # spacemacs (8)
- # test-check (4)
- # unrepl (3)
dumb question of the day: can you add a fsepc to a defmethod? (I remember reading somewhere you couldn't but I think I'm misremembering and google has been failing me)
You can't. you can spec the dispatch fn or/and create separate defns that will be called by the multimethod impl
I hadn't thought about specing the dispatch function but it is obvious now that you point it out
@alexmiller pointed that out the other day, didn't think of it either before then š
That covers the args side at least
oh, sorry didn't see you there @alexmiller;-)
@alexmiller I was a bit surprised yesterday and today w/instrumenting an fspec. It looks like it calls gen/check on the way in which I wasn't expecting (21 times if I'm reading correctly)
we got caught out b/c we had a spec that was wider than the code that was being called
Yeah, you are not the first
Is leaning on spec's conform/unform to do translations to and from some outside api an intended and/or acceptable use case? IE if the api gives dates and integers as strings and i need to convert them to java dates and real ints when the come in, and convert them back to strings when they go back out to the api, and there are a lot of varied translations like this in a nested structure. I'm thinking I spec all the incoming string data with conformers, then additionally spec out all my own representations as normal. Is there a reason I'm missing not to do this?
This recent thread is probably a good starting point https://groups.google.com/d/msg/clojure/Tdb3ksDeVnU/LAdniiZNAgAJ
I would have sent a PR for the site repo -- but conformer
isn't even mentioned anywhere there. So I think it would have to be a docstring update for the function itself? @alexmiller thoughts?
Itās intentionally not mentioned as anti documentation :)
but maybe it should be more explicitly unmentioned :)