This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-01
Channels
- # admin-announcements (8)
- # arachne (11)
- # beginners (17)
- # boot (64)
- # cider (26)
- # cljs-dev (7)
- # cljsrn (1)
- # clojure (115)
- # clojure-belgium (2)
- # clojure-dusseldorf (15)
- # clojure-poland (15)
- # clojure-russia (62)
- # clojure-spec (86)
- # clojure-uk (208)
- # clojurescript (36)
- # cursive (4)
- # datavis (11)
- # datomic (44)
- # editors (9)
- # hoplon (21)
- # jobs (4)
- # mount (21)
- # off-topic (3)
- # om (113)
- # onyx (65)
- # parinfer (2)
- # perun (3)
- # proton (6)
- # re-frame (29)
- # reagent (20)
- # yada (3)
I want to get some data from a Jira REST API. Any advice on getting started? Found rest-clj on github, but it hasn’t been updated since April 2013.
There’s no meaningful way to do that in Clojure(Script) because whenever you produce an updated version of the tree, it’s a different data structure and the parent
would still point to the old version anyway.
It’s another one of those situations where the solution in Clojure(Script) is just a different idiom — you can’t translate the code literally.
The better question to ask @krchia is probably "How is parent
used in the JS code? How would you achieve the same effect with an immutable data structure?"
I suspect the answer is: for a node with a nil
parent, its parent
is itself.
Translating between an imperative language that does pretty much everything with mutable state to a functional language (with immutable data structures) is going to be very hard.
I’ve said before that I don’t think it’s the easiest way to learn cljs.
Because at the code level, certain idioms are just radically different — and you have to think about solutions to some problems in a totally different way.
You’d need to figure out what problem the JS code is solving at a high level and then design a functional solution to that problem, and then write cljs.
^ Good advice. Thank you. 🙂