Fork me on GitHub

Has anyone dealt with the Microsoft Graph API, just looking for some pointers on getting started with it. Fairly new to Clojure.


I haven't but I can probably help you with using the Java library


quick google came up with this


For the curious, tried the new a1 (arm64) gen machines on aws with ubuntu linux, java and clojure work nicely :)


(from the readme)


making the same call from clojure would look like this


and the next call on there for getting the users drive


the equivalent clojure would be


(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

sulami12:11:10 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 throws clojure.lang.Reflector.invokeMatchingMethod ( 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)

Alex Miller (Clojure team)14:11:31

What version of Java and Clojure?


Java version 1.8 Clojure version 1.9.0

Alex Miller (Clojure team)15:11:28

Did you try type hinting to the public class to remove reflection?

Alex Miller (Clojure team)15:11:33

Not sure if there is a bug here or not, would be great to have a ticket with more details


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:


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: 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 ... 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]])


OK - my guess is that leiningen uses the arg to :main to construct a call to clojure.core/ns


just confused on how i set a different main function for the dev profile


it’s always worked in the past


the :main option in project.clj is for defining a main namespace, the name -main has special meaning to clojure


curious when this changed.


I suspect that in the past, when clojure was less picky about validating the ns form, it just silently did a GIGO when invoked


a number of tutorials have used this pattern for years


now it complains


yes, the tutorials are wrong as far as I know


well shoot. time to find a new pattern for including wrap-reload in dev mode


that’s a huge problem. going to ask in #beginners ; as like every article suggests this for ring/compojure apps


for now i’ll just omit it and rely on lein ring server for local reloading dev


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


trying now


forwarding this:

technomancy | justin_smith: fixed in 7525142
- so yeah you found a lein bug


and there's a commit with a fix


i feel special now lol


i really appreciate the help on this. please pass my thanks along to technomancy as well


going to comment this out in the mean time and work around it

Curtis Bowman19:11:34

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?

Curtis Bowman19:11:15

@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).

eccentric J19:11:27

That is exactly what I’ve been wanting!

Jimmy Miller20:11:12

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?

eccentric J20:11:22

@U5K8NTHEZ There’s a bit of dialogue on that in the #off-topic channel


+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 🙂 Now let’s wait when someone comes with nREBL 😛


Anyways, super-excited about this development!


Is this a Mac-only app?


Says JavaFX so probably cross-platform?


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))
(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


that's doing the mapv str at compile time, qualifying doesn't mean anything


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=> (defmacro type-0' [l] `(mapv str '(~@l)))
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?

👍 4

issue open on GH, mentioned in #off-topic, it's on HN and reddit. no clarification

🆗 4
Alex Miller (Clojure team)23:11:14

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

👍 24
Alex Miller (Clojure team)23:11:28

But that is not an official answer


understood. it is still release candidate anyways 🙂