This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-11
Channels
- # announcements (1)
- # aws (1)
- # babashka (1)
- # beginners (41)
- # bristol-clojurians (2)
- # clara (2)
- # cljs-dev (7)
- # clojure (18)
- # clojure-europe (1)
- # clojure-finland (2)
- # clojure-uk (9)
- # clojurescript (5)
- # community-development (2)
- # data-science (14)
- # events (1)
- # fulcro (12)
- # joker (12)
- # malli (2)
- # reitit (1)
- # xtdb (1)
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?
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?
I…had it installed like that, and it did not work, but I just reinstalled and now it’s working fine
Thanks for the help 🙂
"a clj-based uberjarrer " what does that mean? i can't even google the references hidden in it...
It's a Jar that pack your program and all of its dependencies. https://stackoverflow.com/questions/11947037/what-is-an-uber-jar https://imagej.net/Uber-JAR
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?
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
You push the root node on the queue and then loop over pulling stuff out, putting new child nodes on the queue until done
That lets you handle data structures of arbitrary depth without getting stack overflow
bread-first traversal, specifically, I think.
Fun typo 🙂
Could be either potentially
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.
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
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: https://stackoverflow.com/questions/58571928/how-can-i-read-a-single-character-from-stdin-in-clojure. 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 https://clojureverse.org/t/reading-standard-input-one-character-at-a-time/5354?u=jewietUnless 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
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