This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-29
Channels
- # adventofcode (7)
- # announcements (11)
- # beginners (76)
- # boot (3)
- # calva (139)
- # cider (24)
- # clara (2)
- # cljdoc (11)
- # cljs-dev (90)
- # cljsjs (1)
- # cljsrn (3)
- # clojure (98)
- # clojure-austin (2)
- # clojure-brasil (2)
- # clojure-dev (16)
- # clojure-europe (3)
- # clojure-italy (55)
- # clojure-nl (37)
- # clojure-sweden (11)
- # clojure-uk (40)
- # clojurebridge (1)
- # clojurescript (107)
- # core-logic (10)
- # cursive (34)
- # data-science (9)
- # datascript (19)
- # datomic (48)
- # emacs (6)
- # figwheel (13)
- # figwheel-main (3)
- # fulcro (67)
- # jobs (1)
- # juxt (4)
- # lumo (8)
- # mount (1)
- # off-topic (29)
- # onyx (1)
- # reagent (7)
- # reitit (3)
- # ring-swagger (5)
- # shadow-cljs (39)
- # spacemacs (5)
- # tools-deps (1)
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
@U8K4E83L2 I got recommended http://quil.info/, and I managed to get lwjgl working, following this repo: https://github.com/rogerallen/hello_lwjgl 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
I figured here was a good place to announce that I’m going to be live streaming AoC this year. Weekdays @ 12:00 CST https://www.twitch.tv/timpote
Specifically going to be targeting Clojure beginner-intermediates. So if you know someone trying to pick up clojure, please point them my way.
Is using :refer :all when requiring libraries code smell?
unless the library is very small, probably
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.
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
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?
the value of seq is a mixture of vectors and lists. I’ll give it a go and see
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
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"Hey guys
I'm making some interop on Java in Clojure for Twilio
How can I see the properties inside this #object ?
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
I couldn't with (prn [(class x) x]), and with clojure.reflect/reflect
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: https://clojurescript.org/tools/testing#fixtures
I tried using a function instead of a map, still no dice: (use-fixtures :once (partial prn "====="))
Tried looking at the source, hain't any idea what's going on there https://github.com/clojure/clojurescript/blob/9a8196ebfe4265feda88a06de84affb9df469012/src/main/cljs/cljs/test.cljc#L382
with async you get the maps with before and after, and without async you get clojure.test style
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?
Looks like execution-strategy
is a bit tautological; it does :sync if the fixture is a fn; :async if it's a map
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
/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home
➜ ~ /usr/libexec/java_home -v 1.8
/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
@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 https://stackoverflow.com/questions/26252591/mac-os-x-and-multiple-java-versions
This seems the simplest approach https://stackoverflow.com/questions/46513639/how-to-downgrade-java-from-9-to-8-on-a-macos-eclipse-is-not-running-with-java-9
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?
"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))"
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 https://github.com/ztellman/primitive-math).
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: https://gitlab.com/azzurite/twitch-chat-notifier Is there anything obvious I am missing? can someone help me?