This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-11
Channels
- # adventofcode (31)
- # announcements (6)
- # babashka (5)
- # beginners (93)
- # calva (15)
- # cider (20)
- # cljs-dev (16)
- # clojure (159)
- # clojure-berlin (1)
- # clojure-dev (5)
- # clojure-europe (9)
- # clojure-italy (9)
- # clojure-losangeles (2)
- # clojure-nl (26)
- # clojure-spec (7)
- # clojure-uk (33)
- # clojurescript (54)
- # clojutre (5)
- # cursive (20)
- # datomic (23)
- # emacs (19)
- # events (1)
- # expound (1)
- # figwheel-main (1)
- # fulcro (104)
- # hyperfiddle (1)
- # jobs (1)
- # luminus (10)
- # malli (59)
- # nrepl (1)
- # off-topic (11)
- # pathom (5)
- # planck (15)
- # reagent (13)
- # reitit (8)
- # rewrite-clj (10)
- # ring-swagger (3)
- # shadow-cljs (129)
- # tools-deps (46)
- # xtdb (14)
- # yada (1)
Morning.
måning
i.e., (json/parsed-seq (io/reader "/home/david/Downloads/a-big-file-of-lovely-json-data.json"))
@dharrigan (set! *print-length* 10)
and (set! *print-level* 3)
to control depth of traversals
perl -i -p -e "s/*//g;" a-big-file-of-lovely-json-data.json
🙂 That’ll fix it for the REPL
@dharrigan if it makes sense for your use-case, i tend to prefer JSON-lines to vanilla JSON for larger amounts of data
Thanks for the tip @mccraigmccraig!
and also @rickmoynihan
i always enjoy it when CIDER-repl gets to print out some massive datastructure 😬
@mccraigmccraig It’s what the kettle was invented for 🙂
i need to grow some extra kidneys to cope
I find I bump into that problem less often when I use a Rich comment block and c-x c-e
and cider-inspect...
more often
You know if you have a nested map, is there a quick way of evaluating a nested structure in the REPL, similar to let, i.e., in let you can do (let [{{:keys [foo]} :bar} baz] foo)
where foo
is inside bar
, i.e., (def baz {:bar {:foo "wibble"}})
I want to play around with the destructuring on the REPL and I find myself just typing in the entire let
form (as previous). Ideally, I would like to do this at the REPL: => {{:keys [foo]} :bar}}
and for it to print out wibble
I use (get-in thing [:foo :bar])
I dislike nested destructuring - it is difficult to re-read
but I might just be a grump
(becomes more relevant for a deeply nested destucturing, playing around at the REPL)
re. large JSON jq
is also quite a nice tool when it comes to JSON parsing on the command line.