Fork me on GitHub
#beginners
<
2016-08-01
>
boz03:08:33

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.

roberto03:08:01

I normally use clj-http

roberto03:08:09

or clj-http-lite

krchia23:08:31

not sure how to replicate this in clojurescript

seancorfield23:08:22

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.

seancorfield23:08:47

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.

seancorfield23:08:36

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?"

seancorfield23:08:55

I suspect the answer is: for a node with a nil parent, its parent is itself.

krchia23:08:11

clojurescript is shaping to be much harder than i thought

krchia23:08:19

it takes a lot out of me to translate from js to cljs, cljs to js ...

seancorfield23:08:44

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.

seancorfield23:08:02

I’ve said before that I don’t think it’s the easiest way to learn cljs.

seancorfield23:08:23

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.

seancorfield23:08:37

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.

keatondunsford23:08:30

^ Good advice. Thank you. 🙂