Fork me on GitHub
#clojure
<
2016-11-02
>
vandr0iy08:11:58

Hi, #clojure! came to ask: what's the difference between clojure.spec/map-of and clojure.spec/every-kv?

wei09:11:30

if I’m starting an uberjar with the clojure repl from the command line, how do I specify the :host options to allow connections on a foreign hostname/address? trying something like this, but it doesn’t seem to allow foreign connections.

java -Dconfig=config.edn -Dclojure.server.repl="{:port 7888 :accept clojure.core.server/repl :host \"0.0.0.0\"}" -jar testproj-0.1.0-SNAPSHOT-standalone.jar

wei09:11:48

if I’m starting a repl with leiningen, this works:

lein repl :headless :host 0.0.0.0 :port 7888

robert-stuttaford09:11:08

@vandr0iy #clojure-spec is a place 🙂

vandr0iy09:11:41

thanks, heading there right now! 😄

hlolli12:11:58

Is there a way to execute lein clean within clojure or any way such that lein test always starts by cleaning before continueing?

lsenta13:11:24

@hlolli lein clean test ?

hlolli13:11:46

that's a solution, now getting Wrong number of arguments to clean task. but there's something minor missing here.

hlolli13:11:51

lein do clean, test seems to do the trick, thx @lsenta

lsenta13:11:40

@hlolli woops, nice catch. Maybe hooks can help if you really want to force this behavior.

hlolli13:11:53

yes, would like more info about hooks, find the hooks always doing more than I ask them for. So I never use them, but boot solves these kind of stuff beautifully.

cfleming15:11:27

I’m having trouble finding where in the Clojure source code the user.clj file is loaded if present in the root of the classpath.

cfleming15:11:46

All I can see in clojure.main is an (in-ns 'user)

cfleming15:11:57

Can anyone point me to it?

hiredman15:11:36

if I recall it is in clojure.lang.RT

hiredman15:11:34

line 479 or thereabouts

cfleming15:11:39

Oh, in the static initialiser? I’ll check that, thanks.

cfleming15:11:10

That’s it, thanks.

seancorfield15:11:09

@wei It doesn’t look like anyone answered your REPL question? The clojure.server.repl is a Socket REPL server so you can connect to it via telnet but you can’t connect to it via nREPL clients (i.e., CIDER / Leiningen / Boot). I suspect you were trying one of those as your “foreign connection”?

Alex Miller (Clojure team)16:11:39

(although you could start an nrepl server via the clojure socket server support if you liked)

wei16:11:42

@seancorfield the problem is I’m trying to connect to it through a docker container, and the IP is different

wei16:11:06

if I ssh into the container and telnet localhost 7888, I’m able to connect

wei16:11:53

basically running into this problem http://stackoverflow.com/questions/22422820/connecting-to-a-headless-nrepl-running-in-a-docker-container-from-another-contai except I’m running the app from uberjar instead of with leiningen

wei17:11:48

and no, I’m not using an nREPL client, just telnet for testing the connection. I’ve been using inf-clojure, a nice lightweight emacs repl which supports this type of connection

candiedcode18:11:18

can you use docker exec [OPTIONS] CONTAINER COMMAND [ARG...] to connect to your docker container to run nrepl

tetriscodes19:11:52

Anybody got a good guide or trusted solution for using protocol buffers?

tetriscodes19:11:32

flatland/clojure-protobuf is giving null pointer exceptions

turbopape20:11:45

No Clojure cup this year guys?

wei21:11:13

what’s a good way to test whether a string is plaintext or html?

jjfine21:11:42

depends how accurate you need to be

jjfine21:11:48

(defn html? [s] (= \< (first s))) might be good enough