Fork me on GitHub

I've been trying to find some information about using clojure + opengl or at least some sort of tool for creating graphical interfaces. do you have any tips? I want to create a text editor/image viewer


in for answer.


@U8K4E83L2 I got recommended, and I managed to get lwjgl working, following this repo: I'm now working on getting text rendering to work using some examples from the official lwjgl repo


@UEFQTS12B thanks for the tip 🙂 I'll definitely check it out


can you get a more modern look using swing, or are you stuck in the 90s? 😄


I've tried getting javafx to work, but I got stuck


I figured here was a good place to announce that I’m going to be live streaming AoC this year. Weekdays @ 12:00 CST


Specifically going to be targeting Clojure beginner-intermediates. So if you know someone trying to pick up clojure, please point them my way.

Allan Araujo16:11:45

Is using :refer :all when requiring libraries code smell?


unless the library is very small, probably


I very very much dislike :refer :all and use


Much better to require as something and then use the namespaced function. Very clear what you’re doing in that case


And apparently in clojurescript, use only works with :only, and :refer :all isn't supported.


Ya, they learned from their mistake in ClJs


That said, I like to use refer all sometimes. Mostly in my tests. I refer all the namespace I'm testing. And sometimes at the repl it is nice too.


what’s the common pattern for using ring’s wrap-reload these days only in dev mode? defining a :main project.core/-dev-main in your project.clj dev profile now makes clojure explode when you want to start a repl

Felicity Martinez18:11:22

hi, I’m on 4Clojure problem #28 and I am having trouble flattening without using flatten. Someone on the internet suggests using (apply concat seq) but I keep getting an error don't know how to create ISeq . Any hints?


What's the value of seq?


(apply concat [[1 2] [3 4]]) => (1 2 3 4) so I think you're on the right track

Felicity Martinez10:11:48

the value of seq is a mixture of vectors and lists. I’ll give it a go and see

Felicity Martinez10:11:05

so I am writing (fn[s] (apply concat s)) and it’s failing. The sequences being passed are nested lists and vectors. I am not sure what I’m doing wrong

Felicity Martinez13:12:24

Never mind, I sorted it 🙂


Hey all, I can't get the cljs.test/use-fixtures macro working. I'm using refer-macros, with the following in my test file:

(use-fixtures :once
  {:before (fn [] (prn "========="))})

(deftest test-stuff
  (is (= 1 1)))
I just get "0 errors"


where did you get that map with the before key?

Ian Fernandez19:11:02

I'm making some interop on Java in Clojure for Twilio

Ian Fernandez19:11:23

How can I see the properties inside this #object ?

Ian Fernandez19:11:39

I couldn't with (prn [(class x) x]), and with clojure.reflect/reflect


that isn't a correct fixture (you don't get an error because maps are also functions)


a fixture is a function that gets passed a function that executes the tests when invoked


so (fn [run-tests] (run-tests)) is a fixture that does nothing but runs the tests

Ian Fernandez19:11:24

I'm generating an JWT with twilio's api, but JWT returns null values on the body


@hiredman I'm using clojurescript, which has a different signature:


I tried using a function instead of a map, still no dice: (use-fixtures :once (partial prn "====="))


I don't see :before anywhere in the source there, so who knows


hah, of course


test.cljs not test.cljc


it looks like it depends on if you are testing async or what not


whatever that means


with async you get the maps with before and after, and without async you get clojure.test style


Ohh I see it now


I guess that makes sense, though failing silently 😞


and I still can't make it work with just a plain fn


does prn actually do something useful in cljs?

Eccentric J21:11:41

Dealt with that yesterday. The most obvious difference to me was that strings were wrapped with quotes and the map could be read back into cljs unlike println. I think that’s similar to its JVM counterpart right?


as far as I can tell it's the same as println


it works in deftest and outside tests, so I assume it would work in the fixture


but I've struggled with that, so maybe not


I'll try console log


Looks like execution-strategy is a bit tautological; it does :sync if the fixture is a fn; :async if it's a map

David Reno19:11:18

I see that I have multiple versions of java installed. It’s been suggested that I use java 8. Is there a way to configure lein or the project.clj and/or spacemacs dotfile to accommodate this?

➜  ~ /usr/libexec/java_home
➜  ~ /usr/libexec/java_home -v 1.8

David Reno19:11:35

@U05254DQM, relocating the thread. Last one was getting busy!


@UBMFBEWKY Unless you need Java 10 for something, I would simply remove that version (sorry I dont know how to do that on a Mac). If you need Java 10, then there should be a way to set a specific version for JAVA_HOME. If not, you could write a simple bash/zsh script to set JAVA_HOME and call leiningen, adding an alias called lein for the script (hopefully there is a much simpler approach) There are some other options here

David Reno20:11:04

I completely removed java 10. All good now. Thanks for your help.


Usually you choose java by setting JAVA_HOME and adding JAVA_HOME/bin to your PATH


Getting an error with the following `(def prn-chan (async/chan 5 (map println))) (async/onto-chan prn-chan (range 10))` using 1.9.0 and 1.10.0-RC2 and async 0.4.490. Asset failed because it's trying to put a nil value onto the channel, but docs say it only should put non-nil values onto the channel. Is it something I'm missing?


println returns nil


so you transducer is trying to put nils on a channel, which is not allowed


Yeah, "and any non-nil return value will be placed in the channel."


"If a transducer is supplied a buffer must be specified. ex-handler must be a fn of one argument - if an exception occurs during transformation it will be called with the Throwable as an argument, and any non-nil return value will be placed in the channel." but getting this: "Exception in thread "async-dispatch-1" java.lang.AssertionError: Assert failed: (not (nil? itm))"


that may be a badly worded docstring


you are interpreting "and any non-nil return value will be placed in the channel." as "will ignore nils returned" but it can also be interpreted as "don't return nils"


You cannot put nil on a channel


Hello. How do you find out programatically if something is a macro, rather than a function, please? (I'm writing code that would work with standard math functions, as well as with macros from


It's on the meta for the Var


But for writing code, it shouldn't really matter if something is a macro or a function


Yeah, definitely poorly worded then. The way it's worded I'd expect it to be similar to filter identity than to add nil return values into the channel (since it says it specifically doesn't). I'll work on a different solution for my issue


(I have a workaround: (def bit-not-fn clojure.core/bit-not)). But still, any way to tell a symbol resolves to a macro?


metadata on the var has a :macro key


Peter, (meta (resolve '->)) should give you a good start. May not be the best way but it's there


hi, I want to create an uberjar for a project, however, running lein uberjar never finishes, it just seems stuck at the end. When I disable aot compilation, it finishes (but that's not what I want). I've read that it could be that I have to stop all top-level-threads (even though I thought that I didn't create any) so I run (shutdown-agents) but that still doesn't work. Here is the project: Is there anything obvious I am missing? can someone help me?