This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-18
Channels
- # admin-announcements (12)
- # adventofcode (2)
- # beginners (10)
- # boot (340)
- # cljs-dev (1)
- # cljsrn (30)
- # clojure (79)
- # clojure-germany (4)
- # clojure-japan (4)
- # clojure-nl (2)
- # clojure-russia (141)
- # clojurescript (125)
- # core-async (9)
- # datascript (2)
- # datavis (8)
- # datomic (9)
- # editors (5)
- # editors-rus (4)
- # hoplon (69)
- # ldnclj (63)
- # off-topic (1)
- # om (291)
- # parinfer (7)
- # portland-or (3)
- # proton (248)
- # rdf (3)
- # re-frame (14)
- # remote-jobs (4)
Neat!
TIL: the :as
keyword in Clojure's destructuring allows recursive destructuring.
((fn [[[x1 y1] [x2 y2] :as [c1 c2 :as cs]]] {:x1 x1 :y1 y1 :x2 x2 :y2 y2 :c1 c1 :c2 c2 :cs cs}) [[1 2] [3 4]])
outputs
{:x1 1, :y1 2, :x2 3, :y2 4, :c1 [1 2], :c2 [3 4], :cs [[1 2] [3 4]]}
that's pretty wild
arronmabrey++
isn't that the same as [[x1 y1 :as c1] [x2 y2 :as c2] :as cs]?
@gfredericks: yup, I get the same output with that as well. It just goes to show how flexible Clojure's destructuring is.
I've never thought of using anything but a symbol after the :as
. That's pretty awesome
Hi, using cheshire, is there a way to decode json with a date string and convert it to the Date. object?
@sveri: you can look around a thing I've done for university, I had to solve this exact thing. It's mostly contained to this directory - https://github.com/jaen/panda-5/tree/master/src/panda_5/api.
http://github.com/gfredericks/schema-bijections is an alternative approach