This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-03
Channels
- # aws-lambda (6)
- # beginners (38)
- # boot (39)
- # cider (44)
- # cljs-dev (9)
- # cljsrn (96)
- # clojure (142)
- # clojure-dev (6)
- # clojure-dusseldorf (8)
- # clojure-greece (45)
- # clojure-ireland (3)
- # clojure-italy (7)
- # clojure-norway (6)
- # clojure-russia (26)
- # clojure-sg (16)
- # clojure-spec (31)
- # clojure-uk (39)
- # clojurescript (125)
- # cursive (38)
- # datascript (4)
- # datomic (18)
- # emacs (34)
- # figwheel (2)
- # hoplon (3)
- # immutant (23)
- # jobs (1)
- # lambdaisland (2)
- # lumo (13)
- # off-topic (77)
- # om (8)
- # onyx (9)
- # pedestal (2)
- # play-clj (1)
- # re-frame (52)
- # reagent (3)
- # rum (4)
- # spacemacs (2)
- # specter (4)
- # unrepl (37)
- # untangled (8)
- # vim (79)
- # yada (1)
I am faced with a design dilemma. I have data structure consisting of deeply nested records which reflect the domain I am working in. Querying this is very straight fwd using specter. But some of these records contain "behaviour" (ie. anonymous functions as values) in the form of validation functions, transformation functions (for how to transform themselves or other records in the structure), dispatch functions(that decides when to dispatch certain messages), conditions etc. I am debating (with myself) two different approaches: Either use multimethods to walk/query the datastructure/trigger behaviour OR use specter for the same task. My primary (perhaps very unfounded) concern with specter is that my structure contains "behaviour". My concern with the multimethod approach is that it will be messy and hard to maintain. Hope my question is even remotely clear, otherwise happy to clarify and context.
@mac I think using specter is fine for that task
you probably want to use traverse
with reduce
to trigger the nested functions