Fork me on GitHub
#clojure
<
2018-12-09
>
carocad11:12:22

hey guys, has anyone tried to use elide meta flag for aot compilation? I used in directly on leiningen but whenever I inspect the running java jar with visualVm I still see lots of string relating to functions docstrings 😕 any idea what could be the problem?

kulminaator11:12:05

can you show the leiningen line you added ?

carocad12:12:26

I added: "-Dclojure.compiler.elide-meta=[:doc :file :line :added]" here https://github.com/hiposfer/kamal/blob/master/project.clj#L35

kulminaator12:12:30

and from where did you expect elide to remove to remove docstrings, your code or from your dependencies ?

kulminaator12:12:55

odd enough, tried it for a moment myself too and i didn't see any change in my uberjar regardless of adding or removing :jvm-opts ["-Dclojure.compiler.elide-meta=[:doc :file :line :added]"] in leiningen project file

carocad12:12:06

yes, exactly. This is what I am seeing myself as well.

kulminaator12:12:05

sounds like a bug, only question is where 🙂

kulminaator12:12:37

my project is on clojure 1.10-rc4 and leiningen 2.8.1 ontop of openjdk 11

carocad12:12:46

I have clojure 1.9 lein 2.8.1, jdk 8 … mac os 10

carocad12:12:53

do you know of any way to provide this flags manually without passing through lein ?

Alex Miller (Clojure team)14:12:43

Are you aot compiling? This is a compiler flag.

carocad08:12:12

@U064X3EF3 yes I'm aot compiling through lein: lein with-profile release uberjar

drowsy13:12:55

hey, I'm trying to use a java.util.LinkedList from clojure and I'm not able to call the remove(int index) method. It always calls remove(Object o). It tried (.remove theList ^int i) and (.remove theList (Integer. i)) and I'm out of ideas.

timrichardt13:12:52

For me, it only works if I annotate the type of the LinkedList

user=> (def a (java.util.LinkedList. [1 2 3]))
#'user/a
user=> a
(1 2 3)
user=> (.remove ^java.util.LinkedList a 0)
1
user=> a
(2 3)

drowsy14:12:57

yeah that works 🙂. Thanks.

kulminaator14:12:03

in java land one can tell gradle to download dependencies along with sourcecode, so that ide's autocomplete can show you parameter types and and javadoc

kulminaator14:12:13

can i somehow tell the same to leiningen ?

carocad08:12:00

On cursive you can go to the definition of the method and intellij will ask you if it should download the sources. I know it is not what you asked but hope it helps

emccue21:12:00

Is there a quick snippet for adding a repl server to an existing program?

sbronner12:12:32

@U3JH98J4R Also, check out the official nrepl (network repl) documentation on the subject - https://nrepl.xyz/nrepl/usage/server.html#_embedding_nrepl

emccue21:12:17

(im messing about with minecraft mods)

slipset21:12:11

Clojure comes with a built in socket repl.

slipset21:12:59

A bit down on that page, look for “Launching a Socket Server”