Fork me on GitHub
Brandon Olivier04:01:50

I’m trying to add reagent to a shadow-cljs project, but I keep getting “react is not defined” errors. I read the docs on the reagent site, and it looks like I shouldn’t have to do anything but install it. Anybody familiar with this issue?

Brandon Olivier05:01:23

I set up a new browser project, and it works just fine, but when I try to use reagent in the electron example from the website, electron throws the “react is not defined” error


shadow-cljs requires you to install react through npm or yarn rather than cljsjs/react. have you installed it like this?

Brandon Olivier15:01:24

I…had it installed like that, and it did not work, but I just reinstalled and now it’s working fine

Brandon Olivier15:01:28

Thanks for the help 🙂


nowadays i don't even understand what the readme of any clojure repository says


"a clj-based uberjarrer " what does that mean? i can't even google the references hidden in it...


überjarring, that's what it is.




and clj is tools.deps?

👍 4

deps.edn file and the command line tool clj


what is the difference between "tools.deps" and "deps.edn file and cli tool clj"?


The commands clj and clojure are the CLI tools, i.e. commands you can run from the command line.


tools.deps is a library that those commands use. The library tools.deps is also published separately, and can thus be used by programs that do not use clj or clojure commands.


clj and clojure commands read one or more files named deps.edn in your file system when you run them, in a specific list of directories, combining their contents in a defined way, and use that combined contents. tools.deps I have not examined, but I would guess that it takes the data from the caller of various functions in tools.deps, and whether that data came from a file or not is up to the caller.


hi, I am reading the joy of clojure and after the chapter about collections I end up with some questions about PersistentQueue. What are the use-cases for them?

Alex Miller (Clojure team)19:01:31

If you’re doing an algorithm that traverses a tree or graph, you can use it to turn a recursive impl into an iterative impl

Alex Miller (Clojure team)19:01:18

You push the root node on the queue and then loop over pulling stuff out, putting new child nodes on the queue until done

Alex Miller (Clojure team)19:01:46

That lets you handle data structures of arbitrary depth without getting stack overflow


bread-first traversal, specifically, I think.

Drew Verlee19:01:45

mmmm bread first

😄 4
Alex Miller (Clojure team)19:01:16

Could be either potentially

Alex Miller (Clojure team)19:01:53

I’d go so far as to say this is the only time I use the persistent queue in Clojure


At least every depth-first traversal implementation I have seen uses a stack, where a Clojure vector conj/pop is useful.

Alex Miller (Clojure team)19:01:26

Exactly this lives in the heart of tools.deps to drive dependency graph expansion


uhmm... interesting! I think I could not see this patterns because I never encounter them before at work


many situations the stack was as far as I needed


As a learning exercise I'm making a terminal based interactive program (a game). I want the program to process input one character at a time. Every time a user presses a button, the program processes it and gives output. I couldn't find a way to do it using standard library. I know read and read-line functions but they take an entire line (until enter is pressed). That is not what I want. I searched online and found this solution that uses jline3 Java library: I tried to follow it but when I run my program I'm getting the following warning and error.

WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
Exception in thread "main" Syntax error compiling at (/private/var/folders/nt/26pz2dqj4y70z38vrtgd8t4m0000gn/T/form-init7411586405251765923.clj:1:125).
Caused by: java.lang.IllegalArgumentException: No matching field found: read for class org.jline.terminal.impl.DumbTerminal
I don't know how to enable debug logging. I'm working on OSX and iTerm2. I have asked the same question here


is it problematic to store multiple atoms inside an atom?


maybe there should just be a top level atom


Unless you’re in rare waters most probably you just want an atom with a map holding all the values you would have put in the sub atoms


Can you describe what you need to accomplish?


I'm only writing a toy lib for fun so I'll go with one atom. It's by far the smallest concession I'll have made so far


(def db (atom [
                ["some/file/location/5" (atom {})] ... ["some/file/location/0" (atom {})]
I'm converting what was a single key value pair ["some/file/location/0" (atom {})] into a list of multiple KVPs


Atom in atom isn't a very great pattern in my opinion


I also believe it breaks the atomicity guarantees


If you have such a situation, you might be better served using refs