This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-02
Channels
- # announcements (1)
- # beginners (119)
- # calva (2)
- # cider (40)
- # cljsrn (14)
- # clojure (145)
- # clojure-dev (122)
- # clojure-europe (4)
- # clojure-italy (9)
- # clojure-nl (5)
- # clojure-spec (2)
- # clojure-uk (32)
- # clojuredesign-podcast (1)
- # clojurescript (10)
- # cursive (44)
- # data-science (1)
- # datomic (53)
- # defnpodcast (6)
- # emacs (6)
- # fulcro (13)
- # garden (25)
- # graalvm (3)
- # graphql (7)
- # jobs (3)
- # liberator (4)
- # nrepl (1)
- # off-topic (21)
- # quil (27)
- # reagent (4)
- # reitit (2)
- # remote-jobs (1)
- # ring-swagger (3)
- # shadow-cljs (3)
- # spacemacs (24)
- # sql (29)
- # tools-deps (68)
- # xtdb (2)
@otfrom do you mean names like ->bar-chart-grouped
and ->bar-chart-stacked
. Hmm, sorry, I don’t think that is what you are asking. Can you give an example in the codebase, Is it in the ingest/transitions.clj file (as this seems to have several similarly named functions?
I think I mean:
- stacked-column-data https://github.com/MastodonC/witan.send.ingest/blob/master/src/witan/send/ingest/chart.clj#L133-L143
- transition-year-factor https://github.com/MastodonC/witan.send.ingest/blob/master/src/witan/send/ingest/chart.clj#L284-L294
- transitions-data https://github.com/MastodonC/witan.send.ingest/blob/master/src/witan/send/ingest/excel_report.clj#L20-L23
- I feel the (into...)
bits in ->csv
should be separate functions https://github.com/MastodonC/witan.send.ingest/blob/master/src/witan/send/ingest/transitions.clj#L67-L74 & https://github.com/MastodonC/witan.send.ingest/blob/master/src/witan/send/ingest/valid_states.clj#L11-L16
so, I think the core of the question is: what do you name functions that are just re-working a data structure so it can feed into something else?
If I have a domain concept xxxx
, I’ve used things like xxxx-as-cljcsv
for a Clojure data structure that’s a fairly direct representation of CSV and xxxx-as-csv
for a string version.
I think my problem is that I have a vector of vectors that is common across csv and xls that I'd like to just factor out and I don't know what to name that
it isn't usually completely generic as there is often a transducer with a map and a juxt to pull out the fields in the order I want
I suppose I do have a general "take this seq of maps and turn it into a seq of vectors with column headers at the top" that I should factor out
that I just pass in a vector of the keys for the order, a map of keys to column names and then the vector of maps of the data
I think the pivots where I'm going from a seq of maps to a map of key -> vector of numbers is a bit trickier to name (this is for grouped and column charts)
(If I’m following…)
Maybe you could have separate concepts of xxxx
, xxxx-as-vv
and vv
.
And come up with a name for the “map of key -> vector of numbers” thing. Maybe xxxx-as-grouped-map
and grouped-map
.
Morning
I think I mean:
- stacked-column-data https://github.com/MastodonC/witan.send.ingest/blob/master/src/witan/send/ingest/chart.clj#L133-L143
- transition-year-factor https://github.com/MastodonC/witan.send.ingest/blob/master/src/witan/send/ingest/chart.clj#L284-L294
- transitions-data https://github.com/MastodonC/witan.send.ingest/blob/master/src/witan/send/ingest/excel_report.clj#L20-L23
- I feel the (into...)
bits in ->csv
should be separate functions https://github.com/MastodonC/witan.send.ingest/blob/master/src/witan/send/ingest/transitions.clj#L67-L74 & https://github.com/MastodonC/witan.send.ingest/blob/master/src/witan/send/ingest/valid_states.clj#L11-L16
A quick reminder that the "Exploring REPL tooling with socket prepl" has moved to Tuesday 16th July, at the same venue, SkillsMatter. https://www.meetup.com/London-Clojurians/events/262000841/
so, I think the core of the question is: what do you name functions that are just re-working a data structure so it can feed into something else?
@otfrom <<that are just re-working a data structure>> As in “transform”? Or am I losing context somewhere?