Fork me on GitHub
#cursive
<
2021-12-27
>
Fudge07:12:29

how to read a json file in clojure

AJ Jaro21:12:02

This is probably a better question for #clojure, but previously I’ve used https://github.com/dakrone/cheshire to parse json

cfleming22:12:33

Yes, definitely a better question for #clojure, this channel is for discussion related to Cursive.

grierson14:12:02

Hey, Can I setup many clojure projects (deps.edn) within one Intellij Idea/git project? Don't need to share dependencies across projects just want to maintain them all within one project. Like a .sln file within C#

myproject/
    shopping-cart
        deps.edn
        code.clj
    other
        deps.edn
        code.clj

cfleming22:12:58

Yep, you can import a project like this using https://cursive-ide.com/userguide/deps.html#working-with-multi-module-projects, or you can just add new modules to an existing project any time.

misha15:12:17

greetings! is this known? usage/resolution highlights suggest first x is used in :or , when in fact the one from :keys [x y] is used.

(let [x 1
      {:keys [x y] :or {y x}} {}]
  [x y])
=> [nil nil]

cfleming22:12:48

I’m not sure, there are a few errors around :or, but it’s hard to search for in Github since it ignores the colon. I can’t see anything matching that case though, could you file an issue?

grav18:12:58

Apparently, relying on possibly destructured keys is undefined behaviour. In this case, the run-time seems to disagree with Cursive's static analysis, but neither is "correct", if I understand it correctly 🙂 https://clojurians.slack.com/archives/C03S1KBA2/p1639584960418600

grav18:12:01

Or maybe, rather, anything is correct. Watch out that you're not launching any rockets, @U051HUZLD 😄

bellissimo 1
misha19:12:17

I replaced my spec-based implementation with a call to clojure.core/destructure, so I'll accept any destination where ever it takes me :D