This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-18
Channels
- # architecture (14)
- # beginners (89)
- # cider (336)
- # cljsrn (2)
- # clojure (181)
- # clojure-berlin (1)
- # clojure-dusseldorf (3)
- # clojure-finland (4)
- # clojure-germany (5)
- # clojure-italy (18)
- # clojure-norway (10)
- # clojure-spec (9)
- # clojure-uk (94)
- # clojurescript (84)
- # cursive (3)
- # data-science (4)
- # datomic (82)
- # emacs (2)
- # events (4)
- # figwheel (1)
- # fulcro (6)
- # graphql (2)
- # hoplon (46)
- # instaparse (24)
- # jobs (9)
- # lein-figwheel (2)
- # luminus (18)
- # lumo (3)
- # mount (1)
- # off-topic (14)
- # onyx (17)
- # parinfer (22)
- # planck (1)
- # protorepl (1)
- # re-frame (50)
- # reagent (7)
- # ring-swagger (6)
- # rum (4)
- # shadow-cljs (94)
- # spacemacs (9)
- # specter (7)
- # tools-deps (2)
- # uncomplicate (4)
- # vim (33)
hey, architects--- I'm trying to design an API, and my first idea isn't compatible with spec. Can anyone suggest alternatives? https://clojurians.slack.com/archives/C1B1BB2Q3/p1523995746000171?thread_ts=1523995746.000171&cid=C1B1BB2Q3
Facts about the domain: - every simplex is a special case of a complex, but there are complexes that are not simplexes - the Java library I'm wrapping understands only integer vertices, so I want to have implementations that map arbitrary non-collection data to integer vertices - users might want to provide their own implementations, to shortcut certain naive approaches that are exponential time
I want to use many specs to add value to the Java library, but the way I've gone about this, I'm trying to spec protocol functions which is not actually possible
There is a suggestion to use wrapper functions --- I only sort of know what that means, but I'll be meditating on it
I would push back on "isn't compatible with spec" spec has a lot of different parts, and some parts don't work well protocol functions
The "wrapper function" thing just means (defn make-frobber [] (let [init-val 123] (Frobber. init-val)))
or some such
oh my bad, I thought your reference to wrapper fns were about another conversation in another room...
So, wrt wrapping a protocol fn... Wouldn't that just mean defining a top level function that calls the protocol fn on the object passed in? And then instrument that?
for me, I don’t think that’s worth doing - I would just not spec the protocol functions
it’s ok not to spec everything :)