This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-07-01
Channels
- # admin-announcements (1)
- # beginners (16)
- # boot (22)
- # cider (96)
- # clojure (146)
- # clojure-dev (5)
- # clojure-germany (7)
- # clojure-greece (3)
- # clojure-italy (5)
- # clojure-japan (76)
- # clojure-russia (6)
- # clojure-seattle (1)
- # clojure-sg (1)
- # clojure-uk (19)
- # clojure-ukraine (1)
- # clojurescript (114)
- # code-reviews (11)
- # datomic (42)
- # editors (4)
- # euroclojure (3)
- # jobs (18)
- # ldnclj (59)
- # off-topic (1)
- # om (17)
- # reagent (5)
- # yada (43)
what’s a better way to do this?
(let [users [{:id 1 :name "Michael"}
{:id 2 :name "Steve"}
{:id 3 :name "Ben"}
{:id 4 :name "Michael"}]]
(->> users
(group-by :name)
(map (juxt key #(->> (val %)
(map :id)
(set)
(hash-map :ids))))
(into {})))
After group-by
, is there a way to map
the values without turning the whole thing to sequence and have to convert back to a map again?there's no way to avoid building a new map. But could use reduce-kv or into with a map transducer to avoid the intermediate sequence.
got it. thanks @alexmiller
i feel like such a newb guys, i’m looking at the ClojureScript QuickStart and can’t get cljs.jar to build the hello world example
java -cp cljs.jar:src clojure.main build.clj
Error: Could not find or load main class clojure.main
@chadhs: you might already know it, but using boot or lein would be much easier to run clj program or a repl to play with clojure code
@xhh oh definitely and thank you. the quickstart just has you grab the stand alone for a quick tour
my evil plan is to rewrite a frontend for a Django site that is currently backbone/coffeescript/icanhazjs in ClojureScript. crazy?
copief for the #C03S1L9DN channel: https://twitter.com/bus_kanaka/status/616026801412804608
Hi, I'm wondering - what's the best way to introduce websockets connection in a ring app? I'm looking for a solution which doesn't require writing client side in clojurescript and would provide connection multiplexing (like channels in http://socket.io or elixir's phoenix framework). I'm aware of solutions like sente or aleph, but as stated before - am looking for a pure JS solution on the client side. Thanks!