Fork me on GitHub

Lets say I have ClojureScript data for example a Map. Is there an idiomatic way to transfer that data to a Clojure project / repl where I have access to some libraries not available in ClojureScript? So I need to use ClojureScript for getting the data, and I want to use Clojure for transforming that data. How would I go about this?


copy to clipboard edn output and then read from clojure?


To transfer when running the applications, add an API to the Clojure application (using reitit or compojure) and call the API from the ClojureScript application


perfect, thank you!

Stephan Renatus19:01:23

🤯 I just can’t figure out which setting in vscode is giving me the “bad indentation” highlighting here 👇 By any chance, does someone know the knob to turn? I’m not using many extensions…


Assuming you are using #calva, check out.

Stephan Renatus19:01:43

I’m using calva, and it does work, too; but since I know these indentation warnings from other languages, I thought it was generic VSCode thing that’s interfering. but I’ll have another look at the docs, thank you!

Stephan Renatus19:01:49

😅 this is really annoying

Stephan Renatus19:01:08

yes!!! thank you so much. the one I suspected the least tbh. that’s on me. Thanks again.


I set the coloring for that extension to be transparent shades of grey or shades of my theme's main background color, increasing in darkness/opacity with further indents. And disable the warning color for Clojure.

Stephan Renatus19:01:24

thanks, disabled that for clojure, too. that’s the best of both worlds. 🥳

✌️ 2

Is there a analogue for Clojure, where I can look up function definitions?

Stephan Renatus19:01:53

💭 How does that work without types? Don’t all n-ary functions look the same, except for function/arg names?


Hoogle allows you to search via type signatures and find functions that fit those types sure. I meant in a more general sense is there a preferred site to simplify looking up clojure functions and their definitions.

practicalli-johnny19:01:03 has a look up for Clojure core, includes a link to the source code of each function

Alex Miller (Clojure team)19:01:05

^^ give it arg /returns, leverages specs to find the function


@U03EK3XB4S3, I'm curious what type of search you're trying to do. I started working on a similar thing for clojure, but couldn't figure out what kind of searches might be useful.


thanks for the above suggestions. I think you guys are over-thinking what I was looking for. I was looking for a more centralisalised documentation wiki for major clojure functions. Nothing involving any pattern matching magic! 🙂 I also found which just redirects to other pages, but is useful:


If you're trying to find relevant libraries, I recently released and have found it useful. There's also #C8V0BQ0M6

🙌 2
🔖 2

Perhaps not exactly what you are looking for, but I think one super power of Clojure is the queryable runtime: apropos, find-doc, doc, and source among others

☝️ 6
Danilo Oliveira20:01:04

Noob question. In reagent leiningen template, some code like this is written: (defn page-for [route] (case route :index #'home-page :about #'about-page :items #'items-page :item #'item-page)) Why is the #' used? I removed this symbol and the page still works. Looks a bit Common Lisp/Lisp 2 using a special notation to refer to functions...


Make a visible change to the implementation of home-page (or any of the others), reevaluate it and reload the page. Do you see the change with the symbol? How about without it? #' is the var quote: The last example on clojuredocs showcases its usefulness:

Danilo Oliveira21:01:26

still works, I'm using shadow-cljs

Fredrik Andersson21:01:40

Hi, I'm going through the lacinia tutorial and they reference dev-resources/user.clj . But I don't understand how that works. And I cant find any references on google. Does anybody know what they mean?


> We can add a bit of scaffolding to the user namespace, specific to our needs in this project. When you launch a REPL, it always starts in this namespace.

Fredrik Andersson21:01:18

yes, but what does that mean?


When you start a REPL it has to always be in a namespace. By default is the namespace user


Clojure at runtime looks for user.clj on the classpath and will use this to define the namespace if found

Fredrik Andersson21:01:49

okay, so I can put the user.clj in the src/ folder?


you could, but then it would always be present. It’s preferrable to put it somewhere so it is conditionally on the classpath


that’s why they are using dev-resources. When doing dev this will be on the classpath but this (presumably) won’t be added to any artifacts you make


> We can define the user namespace in the dev-resources folder; this ensures that it is not included with the rest of our application when we eventually package and deploy the application.

Fredrik Andersson21:01:49

allright, so i would add dev-resources to sources in project file?

Alex Miller (Clojure team)21:01:30

just fyi, "By default is the namespace user " is not necessarily true - this is up to the repl implementation and there are repls that do other things. Loading user.clj is special in the Clojure runtime and independent from whatever choice is made in how the repl starts (and whether there even is a repl)

Fredrik Andersson21:01:53

okay, im using vanilla lein


(thanks for the clarification. i get a bit handwavy on how all of this works)

Fredrik Andersson21:01:20

thanks, now I understand


for lein you’ll want to use the profiles and add it in a profile that won’t be in effect when building your artifacts

Michał Frątczak22:01:47

Why doesn't it loop indefinitely? Because clojure is lazy?

(loop [i 0]  
  (when (< i 5)    
    (println i)    
    (recur (inc i)); loop i will take this value


the only way it continues loop is when the recur form is invoked. And that only happens when (< i 5)


Each time you recur you increment i and it will eventually be greater than 5. So the when form returns nil rather than evaluating the println and recur

Michał Frątczak23:01:30

ahh yes! that when closing ) is very important 🙂


yeah if you were to barf the recur out of the when you would get 5 prints to your output and a very warm computer 🙂


Clojure is not lazy, btw. It is strictly evaluated.


It has lazy sequences in the core library , but the language itself is strict


"ahh yes! that when closing ) is very important 🙂" Slippery little devils, those (s and )s. I ignore them, look at the indentation. Mind you. I hit the "re-indent" key chord mode than I write code.

👍 4