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)
Has anyone dealt with the Microsoft Graph API, just looking for some pointers on getting started with it. Fairly new to Clojure.
For the curious, tried the new a1 (arm64) gen machines on aws with ubuntu linux, java and clojure work nicely :)
(those snippets cover quite a few clojure idioms and features, so feel free to ask for more info)
have anyone here used clojure with opengl or similar? I'm having a hard time finding information about how to go on about it
http://quil.info is a good start if you just want something drawn
thanks a lot @U9W4GLX4L, looks really neat. I'll dig into it. I managed to get lwjgl working as well, so might use that. but quil looks really cool as well
Hi guys,
I'm using the AWS Java SDK V2 and am getting IllegalArgumentException Can't call public method of non-public class: public final java.lang.String software.amazon.awssdk.core.BytesWrapper.asUtf8String() throws java.io.UncheckedIOException clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88)
when trying to access the public functions of a non-public super-class of an object.
specifically: I'm using the getObject
method on an S3AsyncClient
object with the ByteArrayAsyncResponseTransformer
to get on object as a byte array.
the returned value is an object from the public class ResponseBytes
that extends the BytesWrapper
abstract (non-public) class.
But because of the reflection implementation of Clojure, I'm unable to access any of the public methods of BytesWrapper
(such as asUtf8String
).
Do you guys know of anyway to access these super methods?
@eyal.shalev i've hit this problem before - iirc you have two options - [1] is to write some java which exposes an interface you can call from clojure and [2] is hacky but doesn't require any java and is to override the access modifiers (assuming your SecurityManager permits it) https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/AccessibleObject.html
What version of Java and Clojure?
Did you try type hinting to the public class to remove reflection?
Not sure if there is a bug here or not, would be great to have a ticket with more details
the bug i was hitting a while back was : https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4283544
although looking at the problem i hit it was the other way around from @eyal.shalev’s problem (package private impl inheriting from public interface), so may be a similar looking but different issue: https://github.com/nats-io/java-nats/pull/35
Hey guys, why isn't javax.websocket
extension available to me?
I'm trying to import it but without any success.
I am trying to get a Clojure/Leiningen project going on a Windows 10 machine (was using Mac). I installed the Linux Subsystyem (Ubuntu) and I am connecting remotely to the REPL that is running inside the subsystem. It seems a little slower but it works. What doesn't work though is when I edit a file. I generated the project using Compojure template so it has autoreloading enabled. When I edit a file I get: java.io.FileNotFoundException: Could not locate ring/mock/request__init.class or ring/mock/request.clj on classpath., compiling:(myproject/handler_test.clj:1:1)
. The project auto reloads reliably on Mac - Any idea what is wrong and how to fix it?
I found the solution here https://github.com/technomancy/leiningen/issues/1666#issuecomment-131562170 ... still not sure why it was working fine on Mac though.
have you guys been seeing this error lately at all?
Caused by: clojure.lang.ExceptionInfo: Call to clojure.core/ns did not conform to spec:
In: [0] val: nameofproject.core/-dev-main fails spec: :clojure.core.specs.alpha/ns-form at: [:args :name] predicate: simple-symbol?
i commonly use a -main and -dev-main like this
(defn -main
([] (-main 8000))
([port] (jetty/run-jetty app
{:port (Integer. port)})))
(defn -dev-main
([] (-dev-main 8000))
([port] (jetty/run-jetty (wrap-reload #'app)
{:port (Integer. port)})))
but that error is about your ns form
if i merely comment out this line in my :dev
profile it doesn’t complain
:main nameofproject.core/-dev-main
wait, that's in your ns form?
ns form in core.clj is just this
(ns nameofproject.core
(:require [compojure.core :refer :all]
[compojure.route :as route]
[ring.adapter.jetty :as jetty]
[ring.middleware.defaults :refer :all]
[ring.middleware.webjars :refer [wrap-webjars]]
[ring.middleware.reload :refer [wrap-reload]]
[ring.middleware.session.cookie :refer [cookie-store]])
(:gen-class))
OK - my guess is that leiningen uses the arg to :main
to construct a call to clojure.core/ns
the :main option in project.clj is for defining a main namespace, the name -main
has special meaning to clojure
I suspect that in the past, when clojure was less picky about validating the ns
form, it just silently did a GIGO when invoked
now it complains
yes, the tutorials are wrong as far as I know
that’s a huge problem. going to ask in #beginners ; as like every article suggests this for ring/compojure apps
hmm... talking with technomancy (he avoids slack), and he thinks that is supposed to be supported - can you tell if it's lein calling ns or if some plugin is doing it?
one more thought - if this is happening when starting a repl, what happens if you also define :init-ns
- because one source of this error would be if lein tries to use the value of :main to decide what ns to put you in at startup
@U051SS2EU thanks! would i set init-ns to project.core like im doing for :main?
right, but just the ns, not the function name - technomancy verified if he deleted the :init-ns option he can replicate this error
forwarding this:
technomancy | justin_smith: fixed in 7525142
- so yeah you found a lein bugand there's a commit with a fix
i really appreciate the help on this. please pass my thanks along to technomancy as well
Just watched Stu's talk on REBL and would love to spend the afternoon messing around with it. Does anyone know when/where the early access will be made available?
Very soon
@alexmiller Awesome, I wasn't sure if it had already been published and I just wasn't looking in the right place. I've already extended the datafy and nav protocols to some stuff in a side project I'm working on, and I'm curious to see how it works with the REBL browser (or if I've even do it correctly).
https://twitter.com/cognitect/status/1068223505764950018?s=21
That is exactly what I’ve been wanting!
Hey Alex, checking out the license it says. > You may not use REBL for commercial use. Does this mean I can only use this in my spare time, but not for clojure I write in my day job?
@U5K8NTHEZ There’s a bit of dialogue on that in the #off-topic channel https://clojurians.slack.com/archives/C03RZGPG3/p1543520328982200
+1 for clarification on the license. I exclusively develop clojure for a commercial product, so I’m not even downloading it unless I’m able to use it
I wanted REBL since 2016 at least 🙂 https://github.com/binaryage/cljs-devtools/issues/11 Now let’s wait when someone comes with nREBL 😛
hello guys
seems the function args is evaluated before pass to the function
is there a way to fix this or should i think in another approach ?
the macro args are evaluated after they are returned by the macro
but at compile time
(defn foo [l] (type-0 l)) CompilerException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol
the macro args are not evaluated before the macro runs, so if your macro needs a collection, it needs a literal collection as an input
you mean ["hello" "world"] ?
why are you macroing? just so you don’t have to quote your symbols ?
@abdullahibra or [hello world] like in your example
macros are for transforming an input form into a new form to be compiled
they can't operate on data that isn't known when compiling
Good, thank you 🙂
said something wrong at first - now I see why you need quoting there
@abdullahibra oh - double correction - not only does it work without ~@
- it works without using quoting at all
ins)user=> (defmacro type-0 [l] (mapv str l))
#'user/type-0
(ins)user=> (type-0 [a b c])
["a" "b" "c"]
but it's good to use ` so that mapv and str are fully qualified in the result
they're resolved by the runtime, after macroexpansion the mapv expression doesn't exist anymore
oh - fair, so there's no hygeine issue
user=> (defmacro type-0 [l] (mapv str l))
#'user/type-0
user=> (defmacro type-0' [l] `(mapv str '(~@l)))
#'user/type-0'
user=> (macroexpand '(type-0 [a b]))
["a" "b"]
user=> (macroexpand '(type-0' [a b]))
(clojure.core/mapv clojure.core/str (quote (a b)))
REBL looks cool, but I'm curious if it will continue to be closed-source. I realize no one here may know or be able to answer.
i would imagine. i'm totally ok with using a quality closed source product. basically every webapp (including this one) is like that
Does anyone know how to run REBL inside cider/nrepl? nrepl is mentioned in the README
did we get an answer on the "can I use it while while at my day job as long as I don't embed REBL" question?
issue open on GH, mentioned in #off-topic, it's on HN and reddit. no clarification
People are busy with the conf, so give them some time. My personal belief is that the intention is for anyone to be able to use it
But that is not an official answer