This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-26
Channels
- # announcements (9)
- # babashka (98)
- # beginners (53)
- # boot (2)
- # calva (19)
- # cider (58)
- # clj-kondo (4)
- # cljdoc (11)
- # clojure (49)
- # clojure-dev (12)
- # clojure-nl (3)
- # clojure-uk (4)
- # clojurescript (42)
- # core-async (6)
- # cursive (9)
- # data-science (1)
- # fulcro (23)
- # jobs-discuss (2)
- # nrepl (30)
- # off-topic (42)
- # pedestal (6)
- # re-frame (8)
- # reitit (7)
- # remote-jobs (2)
- # shadow-cljs (134)
- # specter (1)
- # vim (13)
Hi folks, what would be the best way to change this:
[
{:name "a" :args [1 2 3]}
{:name "a" :args [5 6 7]}
{:name "b" :args [1]}
]
into this:
{
:name "a" :arg-list [ [1 2 3] [5 6 7]]
:name "b" :arg-list [[1]]
}
I want to take a vector of maps which have a bunch of duplicate :name
values with different vectors of :args
and map the :names
to a vector of vectors of their args.
I'm using Spectre for most of the json transformations, but I'm new to clojure and this transformation is non-obvious to me.