This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-19
Channels
- # beginners (34)
- # boot (111)
- # cider (37)
- # clara (57)
- # cljsjs (1)
- # cljsrn (22)
- # clojure (156)
- # clojure-austin (2)
- # clojure-mke (7)
- # clojure-russia (9)
- # clojure-spec (221)
- # clojure-uk (47)
- # clojurescript (42)
- # code-reviews (4)
- # community-development (9)
- # core-async (3)
- # cursive (50)
- # datomic (81)
- # emacs (12)
- # events (5)
- # hoplon (1)
- # jobs (2)
- # lein-figwheel (4)
- # leiningen (1)
- # luminus (3)
- # mount (2)
- # off-topic (1)
- # om (94)
- # om-next (3)
- # onyx (33)
- # re-frame (23)
- # reagent (41)
- # remote-jobs (9)
- # rum (30)
- # slack-help (2)
- # specter (1)
- # untangled (20)
- # yada (17)
hello all, is there any way to keep teh original data type ?
(sort-by first {:a "1" :z "2" :g "3"}) => ([:a "1"] [:g "3"] [:z "2"])
A hash map is inherently unsorted.
A sequence has an ordering.
No, that won't work.
A hash map is not ordered.
Yeah, if you want a hash map ordered by its keys, just use sorted-map
@fabrao
(sorted-map :a "1" :z "2" :g "3")
You can convert an unordered map to a sorted map: (into (sorted-map) {:a "1" :z "2" :g "3"})
@seancorfield It worked, thanks a lot
boot-cljs compiled my code of el.setAttribute
into a.b
thing and it threw errors. How to use extern files to fix it please?
@jiyinyiyong Shouldn't happen. Can you add @param {Element} element
to the fn parameter and see if that fixes it?
Is there any working example I can refer to? Not managed to define an extern file before..
from the docstring, it doesn't "short-circuit", so it does this for all matching branches, not just the first
but you can look at their implementation here https://github.com/clojure/clojure/blob/clojure-1.8.0/src/clj/clojure/core.clj#L7240