#clojure logs

2015-11-07

00:00bluezoneOh yeah
00:00justin_smith,((fn arities ([x] (arities x 1)) ([x y] {:x x :y y})) 2)
00:00clojurebot{:x 2, :y 1}
00:01justin_smithbluezone: it just requires extra parens around the arg list
00:01TEttingerthomsey, woah, it looks like this was fixed -- just it was fixed less than a month ago
00:01TEttingerhttps://github.com/daveray/seesaw/commit/7e55abf18446837c1c2239f8afb0ef4b419dfa45
00:01justin_smithbluezone: well, arg list and body together - like my example above
00:02bluezonehmm
00:03thomseyHaha. The open source machine churns. Many thanks, TEttinger
00:03TEttingerthomsey hm wait
00:03TEttingerthat might not be the whole story
00:03justin_smithbluezone: it's the difference between (fn [x] x) and (fn ([x] x) ([x y] y))
00:03TEttingerthe delay of 0 should mean it fires immediately
00:03TEttinger(and then keeps firing rapidly)
00:05TEttingerI'm guessing it could be that print isn't either flushing for some reason (no idea what could cause it if it is that), or your console isn't getting data from swing
00:05TEttingerif you start with javaw.exe on windows, it doesn't have a console
00:05TEttingerso print does nothing
00:05TEttingerthat's what double-clicking a jar will run
00:05thomseyTEttinger this is starting to feel like a CIDER problem...
00:06thomseyi'm using cider btw
00:06TEttingertry doing something other than printing maybe?
00:06TEttingerwrite a line to a file?
00:06justin_smithbluezone: try moving ([x] (arities x 1)) so it is directly above ([x y] ...)
00:06TEttingerspit is good for writing throwaway data
00:06TEttinger(doc spit)
00:06clojurebot"([f content & options]); Opposite of slurp. Opens f with writer, writes content, then closes f. Options passed to clojure.java.io/writer."
00:07justin_smithbluezone: so now each line describes a different arity
00:07thomseyYes! (fn [e] (pack! ...)) works as expected
00:07TEttingerha! woo!
00:07TEttingerso it is a print not printing thing?
00:08thomseyYep. Print-not-printing all day.
00:08thomseyMany thanks!
00:08TEttingerthis is the one time I'm glad I've encountered that kind of bug
00:08TEttingerglad to help!
00:08skeuomorfIs there a way to automagically update dependencies when using leiningen? For example, I had `tools.nrepl` as a dependency in my `project.clj` file to make CIDER better. Inside emacs, in the CIDER REPL, I saw a warning that CIDER requires a newer version of `tools.nrepl`, had CIDER never told me that, I wouldn't have known that there's a newer version of `tools.nrepl` and I wouldn't have manually changed the
00:08skeuomorfversion in my `project.clj` file. Is there a way to automagically handle such stuff?
00:09bluezonejustin_smith: I think this may be beyond my level of understanding atm, I'll come back to it later
00:09justin_smithskeuomorf: lein ancient can help with this
00:09justin_smithbluezone: it's just defining two bodies for one function
00:09skeuomorfjustin_smith: Thanks! :)
00:09justin_smithbluezone: each function body on its own line in your editor
00:09justin_smithbluezone: one calls the other
00:10skeuomorfjustin_smith: Very cool, exactly what I wanted!
00:11bluezonejustin_smith: but where is the argument list for arities
00:11justin_smithbluezone: so your version would start with (defn odd-num-seq ([sequ] (odd-num-seq sequ [])) ([sequ appender] ...))
00:11bluezonethe argument vector *
00:11justin_smithbluezone: it has two argument lists
00:11justin_smithit has two argument vectors
00:14justin_smithbluezone: it's just a different syntax for fn / defn
00:15TEttinger,(defn make-blue ([] (make-blue "zone")) ([name] (str "blue" name)))
00:15clojurebot#'sandbox/make-blue
00:15TEttinger,(make-blue)
00:15clojurebot"bluezone"
00:15TEttinger,(make-blue "TEttinger")
00:15clojurebot"blueTEttinger"
00:15TEttingerdifferent number of args given to each, one calls the other
00:16TEttinger([] (make-blue "zone")) is the zero-arg body
00:16TEttingerit calls ([name] (str "blue" name)) , which is the one-arg body
00:17TEttingerin Java, this would be... public String makeBlue() {return makeBlue("zone")} public String makeBlue(String name) {return "blue" + name;}
00:18TEttingerjava splits the different arguments for the same name across multiple blocks or whatever
00:19TEttingerclojure keeps them closer together, but still in separate bodies
00:20rufoaquick question: is there a way to use [Ljava.lang.Object; in a call to `instance?` ? Or do I have use e.g. (class (to-array [])) as a workaround
00:21justin_smith,(instance? "[Ljava.lang.Object;" (into-array [(Object.)]))
00:21clojurebot#error {\n :cause "java.lang.String cannot be cast to java.lang.Class"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.String cannot be cast to java.lang.Class"\n :at [clojure.core$instance_QMARK___4118 invokeStatic "core.clj" 144]}]\n :trace\n [[clojure.core$instance_QMARK___4118 invokeStatic "core.clj" 144]\n [clojure.core$instance_QMARK___4118 invoke "core.clj" -1]\n [...
00:21justin_smith:(
00:21rufoayeah :(
00:23rufoa(i'm wanting to test whether an argument i'm receiving through java interop is a single param or the result of calling a variadic method)
00:24rufoacos you can only match on number of args not type...
00:24justin_smithrufoa: multimethod?
00:24rufoahrm
00:24rufoai'm not convinced it would work in this instance
00:26rufoahang on, can a method you export using gen-class actually be a multimethod? allowing me to do proper mm dispatch
00:26rhg135,(Class/forName "[Ljava.lang.Object;")
00:26clojurebot[Ljava.lang.Object;
00:26rufoaaha!
00:26rufoathanks
00:26rhg135Np
00:31TEttinger,(instance? (Class/forName "[Ljava.lang.Object;") (into-array [(Object.)]))
00:31clojurebottrue
00:31TEttinger,(instance? (Class/forName "[Ljava.lang.Object;") (long-array [0]))
00:31clojurebotfalse
00:31rufoahrm
00:32TEttingerrufoa: the variadic methods are the same as calling with one array
00:32TEttingerI think you knew that
00:33FrozenlockIs there a way to set the value of a field in a java object? I'd like to set the value of 'broadcastAddress', which is declared like so in the java source: 'private Address broadcastAddress;'
00:33TEttinger,(Class/isArray (long-array [0]))
00:33clojurebot#error {\n :cause "No matching method: isArray"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.IllegalArgumentException: No matching method: isArray, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6891]}\n {:type java.lang.IllegalArgumentException\n :message "No matching method: isArray"\n :at [clojure.lang.Compiler$...
00:33TEttinger,(.isArray (class (long-array [0])))
00:33clojurebottrue
00:34rufoayeah TEttinger the method is overloaded to take either String or Object..., so I have both in :methods in my gen-class, then I need to use instance? to check which it actually is inside my fn
00:34TEttinger,(.isArray (class [0]))
00:34clojurebotfalse
00:34rufoaif i'm understanding correctly
00:34TEttingerrufoa: do you mean String... in the java, or Object... ?
00:34rufoa1 String on its own, or Object...
00:34TEttingergotcha
00:35TEttingerwell the Object... can't actually be given a primitive array, so you're good
00:35TEttingerit will get any primitives you pass it and box them
00:35rufoayeah
00:35TEttingerI'd just use .isArray on the class though
00:35rufoai'll give it a go
00:37TEttinger,(.isArray (class "hey guys!"))
00:37clojurebotfalse
00:37TEttingerthe question I suppose is which it prefers
00:37TEttingerI'd guess the more specific type, so String, when it's passed a vararg of one String
00:37rufoathe string from what I can tell
00:37rufoayes
00:38rufoaas it happens they essentially do the same thing anyway
00:38TEttingerbut you could pass a String[] if you wanted to force the Object[] behavior I think
00:38TEttingercool
00:38TEttingeris it a formatting type thing?
00:38rufoaguessed it in one
00:39rufoaone of those classes that has overloads for "one, two, and many"
00:50rufoagot it working great using .isArray TEttinger, thanks for the tip
01:20Frozenlockbluezone: what have you done? I was listening to that music!
01:52bluezoneFrozenlock: bahahaha, sorry. You'll just have follow and tune in tomorrow <3
01:52bluezoneNeed to sleep
04:16douglarekclojure 1.7 javadoc refers java 7
04:17TEttingerdouglarek: hm?
04:17douglarekand http://java.sun.com/javase/7/docs/api/....; should it be http://docs.oracle.com/javase/7/docs/ ?
04:24douglarekok, I just saw the codes, (def ^:dynamic *core-java-api*)
04:24douglarek (case (System/getProperty "java.specification.version"))
04:24douglarek "1.6" "http://java.sun.com/javase/6/docs/api/&quot;
04:25TEttingerclojure is supposed to be compatible as far down as 1.6 I believe
04:25TEttinger(still the best version available for some uses on Mac OS X)
04:25douglarekhttps://github.com/clojure/clojure/blob/master/src/clj/clojure/java/javadoc.clj#L21, and my java is 1.8, so it matches default(it's 1.7)
04:27douglarekTEttinger: i use homebrew cask to install java 8
04:27TEttingerhm, IntelliJ needs to use 6 for some reason, it bundles it
04:27TEttinger(ask cfleming)
04:32douglarekTEttinger: just modify Info.plist <string>1.6*</string> to <string>1.8*</string>
04:41TEttingerwoah. http://foxglovesecurity.com/2015/11/06/what-do-weblogic-websphere-jboss-jenkins-opennms-and-your-application-have-in-common-this-vulnerability/
06:15drorbemetHow can I fuzzy search all loaded namespaces and public symbols in the repl? (apropos "public-symbol") (find-ns 'symbol) don't seem to do this. Something like linux locate just for clojure?
06:17drorbemete.g. I get completion on Math/... - but I don't find it using apropos find-ns or find-doc ...?
06:20opqdonutwell Math is a java class and not a clojure namespace
06:21opqdonutso I guess you'd need javadoc integration for find-doc
06:38drorbemetopqdonut: ok, and that doesn't exist yet?
06:51digiorgiHi, how is called the #'??
06:51digiorgii want to search it in google (:
06:52opqdonutdigiorgi: it seems it's called "var-quote", see http://clojure.org/reader
06:54digiorgiopqdonut: thanks!
07:33noncom|3if i have a java + clojure project, then, according to maven, what my source dirs structure should be?
07:33noncom|3src/main/java and src/main/clojure ?
07:44arryhi! anyone knows how to open two repl buffers in emacs connected to a single nrepl server (or at least to different nrepls but same project)?
07:44arrycider-connect invoked for the second time just overwrites the current repl buffer
07:46arryi need this because i want to run clojurescript repl in one buffer and clojure in another, and because of my setup (using Duct) i cannot invoke piggieback automatically as described in "ClojureScript Usage" in cider's readme
07:47justin_smitharry: maybe M-x cider-replicate-connection
07:54arryjustin_smith: i don't have this function. Cider version 0.9.1 - should i get newer?
07:54OscarZanyone using the windows version of emacs? you think i can get all the tooling work with that? i've been trying to fight but i think i have to succumb to emacs finally :)
07:54justin_smitharry: not sure, I am just going by this https://github.com/clojure-emacs/cider/blob/master/cider-client.el#L853
07:57arryjustin_smith: cool, I'll take a look
10:16drorbemetjustin_smith: concerning our search yesterday, sending clojure code to the cider repl, this works: (cider-nrepl-request:pprint-eval "(+ 3 4)" (cider-repl-switch-ns-handler (cider-current-connection)) nil)
10:16justin_smithcool
10:23douglarekI am reading Clojure Programming Book, page 47 has an repl example, https://github.com/clojurebook/ClojureProgramming/blob/master/ch01-welcome-repl-interactions.clj#L759; I am a little confused
10:24justin_smithdouglarek: any specific question?
10:24douglarekI enter 9, it show me 9,
10:25douglarekbut if i enter "(", and enter '\n', it shows nothing, and then continue entering ")", it shows "()"
10:26justin_smithdouglarek: that's because ( is not a form, but () is
10:26justin_smith,(= () ( ))
10:26clojurebottrue
10:27douglarekjustin_smith: ok, you means : `eval ` will ignore anything between ( and ) ?
10:27justin_smithdouglarek: more specifically, read doesn't return until it gets a full form, and forms are not ended with newlines, they end with a full balanced expression
10:27justin_smithdouglarek: () and ( ) are the same thing
10:27justin_smithwhitespace doesn'
10:28justin_smitht change its meaning
10:28douglarekjustin_smith: thanks a lot,
10:29justin_smithnp
10:29douglarekjustin_smith: you say: read doesn't return until it gets
10:29douglareka full form, maybe it is the key
10:30justin_smiththat's certainly part of it
10:30douglarekjustin_smith: maybe i should read the `read` source
10:31justin_smithif you are just learning, it might be over your head - in fact I think it calls code defined in the java part of the clojure compiler
10:31justin_smithwe can experiment with it here using read-string though
10:32justin_smith,(read-string "() the rest is ignored")
10:32clojurebot()
10:32douglarekjustin_smith: it's cool
10:32justin_smith,(read-string "(error because there is no matching paren")
10:32clojurebot#error {\n :cause "EOF while reading"\n :via\n [{:type java.lang.RuntimeException\n :message "EOF while reading"\n :at [clojure.lang.Util runtimeException "Util.java" 221]}]\n :trace\n [[clojure.lang.Util runtimeException "Util.java" 221]\n [clojure.lang.LispReader readDelimitedList "LispReader.java" 1204]\n [clojure.lang.LispReader$ListReader invoke "LispReader.java" 1049]\n [clojure.lang....
10:33justin_smithread is designed for reading "units" of clojure code - the compilation unit clojure uses when compiling
10:34douglarekjustin_smith: thanks, i use Python more often, and `read` is very different from Python's input
10:34justin_smithmaybe "read-line" is more similar
10:34douglarekmaybe i mixed them
12:14kwladykaI want personalize text like: Hello {{Mr/Ms/}} {{name}} please {{option1/option2/option3}} bla {{site}} bla bla. It doesn't make sense in english, but in other languages it does. On input it will be: gender: male/female/unknown (it determine first word or second or third) and name,site.
12:15kwladykaWhat library can i use?
12:15kwladykaor i have to write it on my own?
12:27rhg135I think clostache or comb will work
12:45kwladykarhg135, thx i will check
12:45rhg135Np
13:46kwladykaDo you have some experience about read CSV file from microsoft excel by clojure.data.csv?
13:47kwladykaI have 2 problems... first it doesn't recognise new column. Second bad encoding.
13:50kwladykaok i found how to separate columns
13:50kwladykabut still problem with encoding
13:52kwladykahmm i guess it is in ANSI
13:55kwladykaanyway all tried with (io/reader file :encoding "Windows-1252") failed
15:58amtcHi, I have a noob question about a 4clojure exercize, about problem 150, the palindromic numbers. I finally got everything to work fast, and then check #5 fails. Anyone in the mood to help me understand?
15:59amtcHere is the problem: https://www.4clojure.com/problem/150
16:00amtcI don't understand why it this true: (= (set (take 199 (__ 0))) (set (map #(first (__ %)) (range 0 10000))))
16:01justin_smithamtc: what that is saying is that there are 199 palindromes between 0 and 10000
16:01justin_smitherr, not exactly that - 199 unique results when you ask for the next palindrome higher then the input between 0 and 9999 more precisely
16:02justin_smith,(set [1 1 2 1 2 3 1 2 3 4 1 2 3 4 5])
16:02amtcThanks justin. But why is 10001 not counted?
16:02clojurebot#{1 4 3 2 5}
16:02justin_smithamtc: it is, that's why I corrected myself
16:03amtcWell, I get 199 for (take 199 (pal 0))
16:03kenrestivoauugh, i added a dep that broke cljs somewhere.
16:03kenrestivoCaused by: java.io.FileNotFoundException: Could not locate clojure/tools/reader/impl/ExceptionInfo__init.class or clojure/tools/reader/impl/ExceptionInfo.clj on classpath.
16:04amtcand I get 200 for (map #(first (pal %)) (range 0 10000)
16:04amtcthe only difference is 10001
16:04kenrestivo[org.clojure/tools.reader "0.10.0-alpha3"]
16:04amtcthat comes from (pal 9999) i suppose
16:05justin_smithand that should be incorrect as an output, because 9999 is a palindrome right?
16:05amtcooooooohhh
16:05amtcright
16:05amtcThanks, that has been bugging me!
16:49hibouhi
16:49hibouis there anything like setdefault in python map ?
16:50hibou{1: []}.setdefault(3, []).append(1)
16:50gfrederickswhat does that do?
16:51justin_smith,({} :b :not-found) ; hibou not the same, because the input is unaltered
16:51clojurebot:not-found
16:51justin_smith,({:b 1} :b :not-found)
16:51clojurebot1
16:51hibousorry
16:52hibouI have a map of integer => list of integer
16:52hibou{1: (1 2) 3: (4 5)}
16:53gfredericks,(def the-map '{1 (1 2) 3 (4 5)})
16:53clojurebot#'sandbox/the-map
16:54hibouI have a tuple (2, 3) I want to verify if the key "2" exists, if yes I will add 3 to the key 2 of the map, if not I will add 2 -> [3] to the map,
16:54hibouso for example for (3, 2) I will have {1: (1 2) 3: (4 5 2)}
16:54kenrestivoproblem found: this breaks clojurscript [com.fzakaria/slf4j-timbre "0.2.1"]
16:55hibouin python this operation is very simple with map.setdefault(2, []).add(3)
16:55gfredericks,(update the-map 1 conj :new-thing)
16:55clojurebot{1 (:new-thing 1 2), 3 (4 5)}
16:55gfredericks,(update the-map 2 conj :new-thing)
16:55clojurebot{1 (1 2), 3 (4 5), 2 (:new-thing)}
16:56gfrederickshibou: ^ if you're really using lists, you don't even have to do anything special
16:56gfredericksfor vectors or sets you can use (fnil conj []) or (fnil conj #{})
16:56oddcully,(merge-with (fnil into []) {:a [1]} {:a [42]} {:b [1]} {:b [666]})
16:56clojurebot{:a [1 42], :b [1 666]}
16:58hibouthanks gfredericks
16:58gfredericksnp
17:06hibouIf i have two similar operations like this, how can I write it differently ? updated-map-vals (update map-vals xi conj yi)
17:06hibou updated-map-vals2 (update map-vals yi conj xi)
17:06kenrestivodealing with dependencies is like playing house of cards. never know which one will cause the whole thing to come crashing down
17:07justin_smithkenrestivo: in my experience loggers are where this really blows up
17:08kenrestivoyep!
17:08kenrestivotimbre-slj4j makes my project explode in a million peices
17:09kenrestivowhy it breaks the reader, i have no idea
17:09kenrestivois there still a factoid bot?
17:09kenrestivo~logging
17:09clojurebotTitim gan éirí ort.
17:09kenrestivo~java logging
17:09clojurebotjava logging is clown shoes
17:09justin_smithhaha
17:10kenrestivoit actually seems like it breaks the classloader
17:11oddcullyhaha
17:11kenrestivoif i'm understanding the error correctly, that is.
17:12kenrestivoCaused by: java.io.FileNotFoundException: Could not locate clojure/tools/reader/impl/ExceptionInfo__init.class or clojure/tools/reader/impl/ExceptionInfo.clj on classpath.
17:12kenrestivoit's definitely on the classpath. but the cljs compiler can't find it, if timbre-slf4j is in the deps
17:12justin_smithkenrestivo: is it pulling in a bad tools.reader version?
17:12kenrestivoversions all look kosher
17:13kenrestivoand if i override, same problem.
17:14justin_smithwhat if something else pulls in a version of tools.reader that it doesn't like? ExceptionInfo was implemented in clojure.core, so I would expect only an out of date tools.reader version would have its own
17:14justin_smithjust a hunch
17:14kenrestivohere's the tree diff https://www.refheap.com/111467
17:14justin_smithmaybe you need that older tools.reader
17:15Bronsa`old tools.reader versions had an ExceptionInfo impl for older version of clojure to fallback to
17:15kenrestivohmm, thanks
17:15justin_smithBronsa`: yeah, that's what I was thinking
17:15kenrestivohttps://www.refheap.com/111468 is the diff, same version of reader
17:15Bronsa`it doesn't anymore since support for 1.3 has been dropped a while ago
17:16kenrestivowhere does exceptioninfo live nowadays?
17:16Bronsa`it's in clojure proper since 1.4
17:17kenrestivohmm... thanks. i'll look through the source for those deps and see where they're trying to pull it in from
17:17kenrestivocould be an easy fix... i hope...
17:17justin_smithkenrestivo: you know about 'lein deps :tree' right?
17:17kenrestivoooh yeah. that's that diff i posted https://www.refheap.com/111468
17:17kenrestivorepresenting the difference between the two lein deps tree between broken and not broken
17:18justin_smithahh, got it
17:18kenrestivoi really should get some kind of ci going. every time i add a dep.
17:19kenrestivothanks bronsa and justin_smith , i feel like i have a better handle on this. will work on it later today.
17:22Bronsa`fwfw 0.9.x are the last releases rolling ExceptionInfo and supporting 1.3
17:46hibouwhy does (conj nil 1) return a list but nothing else ?
17:46hibouconj is a generic function, how does it chose list by default ?
17:54justin_smithhibou: it happens here https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L650
17:55justin_smithpretty readable for java :)
17:55justin_smiththe actual method on IPersistentCollection instances, as you see there, is cons
18:01hibouthanks justin_smith !
18:02hiboujustin_smith, so I can not tell that the type if a set instead of list ? (update the-map 1 conj :new-thing)
18:02TEttinger,(conj #{} 1)
18:03clojurebot#{1}
18:03TEttingerupdate is a more interesting question though...
18:04VenHi! I'm trying to update the dependencies in my luminus project, but I'm hitting a lot of issues doing so. several dependencies started erroring out: "Could not locate markdown/transformers__init.class or markdown/transformers.clj on classpath: ,". I'm not sure what I'm misconfiguring, and why I'm getting an empty classpath
18:05VenI found some answers on internet like http://stackoverflow.com/questions/19110294/could-not-locate-ring-util-request-init-class-or-ring-util-request-clj-on-class, but I don't understand what's going on / why do I need exclusions / how do I know what to exclude from lein deps :tree
18:05hibouTEttinger, you mean I need to write (update the-map 1 conj #{} :new-thing) ?
18:06VenTEttinger? that name reminds me of something *g*
18:07TEttingerheh
18:09TEttinger,(doc conj) ;; does it have any optional args...
18:09clojurebot"([coll x] [coll x & xs]); conj[oin]. Returns a new collection with the xs 'added'. (conj nil item) returns (item). The 'addition' may happen at different 'places' depending on the concrete type."
18:10TEttinger,(doc update)
18:10clojurebot"([m k f] [m k f x] [m k f x y] [m k f x y ...] [m k f x y ...]); 'Updates' a value in an associative structure, where k is a key and f is a function that will take the old value and any supplied args and return the new value, and returns a new structure. If the key does not exist, nil is passed as the old value."
18:11justin_smith,((fnil conj #{}) nil 1)
18:11clojurebot#{1}
18:11justin_smith,((fnil conj #{}) #{2 3} 1)
18:11clojurebot#{1 3 2}
18:11TEttinger,(let [the-map {:a "alpha" :b "beta"}] (update the-map 1 #(if (seq %) (conj % :new-thing) #{:new-thing})))
18:11clojurebot{:a "alpha", :b "beta", 1 #{:new-thing}}
18:11justin_smithhibou: ^ see examples
18:11TEttinger(doc fnil)
18:11clojurebot"([f x] [f x y] [f x y z]); Takes a function f, and returns a function that calls f, replacing a nil first argument to f with the supplied value x. Higher arity versions can replace arguments in the second and third positions (y, z). Note that the function f can take any number of arguments, not just the one(s) being nil-patched."
18:11vendethiel(if anyone knows about the question I asked as Ven, I'm still interested ;-).)
18:11TEttingerahh
18:12justin_smith,(def set-conj (fnil conj #{})) ; better yet
18:12clojurebot#'sandbox/set-conj
18:12TEttingerI know there are people who use luminus here... uh...
18:12justin_smith,(set-conj nil :a 42)
18:12clojurebot#{42 :a}
18:13hibou(doc fnil)
18:13clojurebot"([f x] [f x y] [f x y z]); Takes a function f, and returns a function that calls f, replacing a nil first argument to f with the supplied value x. Higher arity versions can replace arguments in the second and third positions (y, z). Note that the function f can take any number of arguments, not just the one(s) being nil-patched."
18:14hibouthe clojurebot is awsome
18:14TEttingeryep
18:14justin_smithwell yeah, but also "doc" is built in (clojure.repl)
18:14TEttingerthis was linked in #perl6 oddly enough, but I wonder if this is a known used lib in any clojure projects http://foxglovesecurity.com/2015/11/06/what-do-weblogic-websphere-jboss-jenkins-opennms-and-your-application-have-in-common-this-vulnerability/
18:15TEttingerapache commons collections
18:15VenTEttinger: I'm getting such errors on a few components, though, even seemingly-unrelated ones like ragtime: No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil
18:15TEttingerthat's interesting
18:16Venwell.. I just wanted to write a bit of clojure code :[
18:16TEttingerno really, that looks vaguely familiar
18:16justin_smithVen: that means someone gave it a path to a config file or input file that does not exist, usually
18:17Venjustin_smith: ye mean, for ragtime?
18:17TEttingerjustin_smith closes in on the sportball
18:17justin_smithVen: if ragtime is giving the error, that means someone is telling ragtime to open a file or resource that does not exist
18:18justin_smith,(slurp (clojure.java.io/resource "donald trump's dignity"))
18:18clojurebot#error {\n :cause "No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil"\n :via\n [{:type java.lang.IllegalArgumentException\n :message "No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil"\n :at [clojure.core$_cache_protocol_fn invokeStatic "core_deftype.clj" 558]}]\n :trace\n [[clojure.core...
18:18Venjustin_smith: it errors out in "compiling:(/private/var/folders/_3/s9r3mrh17sd0g80dgvflmjtr0000gn/T/form-init1915945053886098775.clj:1:124)",so... no idea if it's ragtime. if I upgrade ragtime, I get a different error though
18:18justin_smiththe error is basically a weird way of saying "file not found", and if you can get the stack trace you will see who did it
18:19Venjustin_smith: everything in the stacktrace is from clojure.main or clojure.lang: at clojure.lang.Compiler.load(Compiler.java:7142)...at clojure.lang.Compiler.loadFile(Compiler.java:7086)...at clojure.main$load_script.invoke(main.clj:274)
18:20justin_smithVen: can you share the trace? typically there will be like exactly one frame that gives away what was really happening and the rest is noise
18:22Venjustin_smith: erm, I was looking at the wrong stacktrace, whoops. at ragtime.sql.files$run_sql_fn$fn__366$fn__367$fn__368.invoke(files.clj:85)
18:22justin_smithVen: so it looks like it wants to run an sql file that doesn't exist?
18:22Venjustin_smith: that very well might be it, yes
18:23justin_smithsounds like config that wants resources provided by a dep that is no longer there
18:26kenrestivohuh. still this makes no sense. nobody seems to be trying to import ExceptionInfo. plenty of places call (ex-info) tho. and the stacktrace doesn't speak to me: https://www.refheap.com/111469
18:32Venjustin_smith: okay, thanks. it stopped erroring out after I finally found it was a half-done upgrade
18:32Vennow it just does nothing instead :P
18:32justin_smithkenrestivo: looks like a transitive dep that imports clojure.tools.reader.impl.ExceptionInfo - I'm thinking transitive dep because you have require higher up on the call stack
18:44justin_smithkenrestivo: it might be something that does the bad thing of importing the class in some namespace, but not requiring the dep that would provide it
19:21kenrestivoi hacked around it by just removing slf4j-timbre and not bothering to log the stuff coming from the library that used it
19:21kenrestivoso... problem solved, change committed.
19:21kenrestivoon to the next problem :)
19:40kenrestivohahaha, which is: lein-migratus doesn't work without slf4j <facepalm>
19:42kenrestivoso i can have either clojurescript, or migratus, but not both. *sigh* oh well..
19:53kenrestivo:profiles to the rescue :)
20:48skeuomorfHow do people do error handling in clojure?
20:49skeuomorfAnd are the list of exceptions documented somewhere?
21:19devthhow to dynamically determine which symbol to bind at runtime in a `binding` clause?
21:20justin_smithyou'd need eval for that
21:20devthoh. right
21:20devthso do i have to quote the contents of eval?
21:21justin_smitheval takes lists of symbols as its input if that's what you mean
21:21devth(let [*s* (determine-symbol ..)] (eval (binding [*s* ...] ...)))
21:21devthso: (let [*s* (determine-symbol ..)] (eval '(binding [*s* ...] ...)))
21:21justin_smithright, but you would need to quote binding and unquote *s*
21:22justin_smithso you likely need ` instead of '
21:22devthoh yeah. been awhile since i've messed with this stuff; forgot most of it :(
21:22justin_smithbest is to find a solution that doesn't require binding an unknown symbol at runtime
21:23devthhave been able to do without until now, but adding an api component forced me in this direction
21:24devthunless i do a significant rewrite
21:24devthanyhow thanks. i'll think about it
21:36vsyncwhat's the quickest way to have a local version of some library, via leiningen, so I can hack non-vendory things into a local branch?
21:36vsynctwist: cygwin
21:37justin_smithvsync: lein install
21:38vsyncjustin_smith: that says it saves the jar locally?
21:38justin_smithit puts it in your local cache, so it is available to other local projects
21:38vsyncohhh, install from hacked codebase
21:38justin_smithright, check out code, fix it up, run lein install, now use that version from another project
21:39justin_smithfor sanity, I recommend changing the version string
21:39justin_smith(in the project.clj)
21:39vsyncnow, say clojars has version numbers listed for the project, but the project has no tags (at least so saith github)... any way of getting the exact source that was called that version, or just guess?
21:41justin_smithvsync: that really depends on the project - if you get lucky, they created a git tag, but worst case pretty much every clojure library includes the full source, and you could just take the version of the jar you use and replace the sources in the repo with the ones in that jar
21:41vsyncoh, that's quite civilized of them
21:41justin_smitha jar file is pretty much a zip file, so getting the source out is easy
21:41vsyncyepper
21:42vsyncso where does leiningen cache things (that I don't "install")? i checked ~/.lein and ~/.m2 and in the project dir but couldn't find much
21:42gfredericks~/.me is where the maven deps get cached
21:42clojurebotOk.
21:42gfredericks~/.m2 I mean
21:42clojurebotCool story bro.
21:42gfredericksclojurebot: ~/.me?
21:42clojurebotTitim gan éirí ort.
21:42gfredericks~what
21:42clojurebotwhat is bbloom bitching about OOP
21:43TEttinger~m2
21:43clojurebotexcusez-moi
21:43TEttinger~me
21:43clojurebotme is greek to it
21:43TEttingerha
21:43gfredericks~/.me
21:43clojurebot/.me is where the maven deps get cached
21:45justin_smithvsync: if you ever pull in a new dep, you'll see leiningen tell you where it is putting the files. But yeah, $HOME/.m2/ is the default (but could be overridden by custom settings)
22:11jeayeIs there a built-in function to recursively update each nested sequence containing a key?
22:13jeayeExample: http://dpaste.com/151GGCN
22:15Frozenlockjeaye: could you rephrase that? You want to modify vectors, not map?
22:17jeayeFrozenlock: Yeah, I see the poor phrasing. I'm looking to update all nested vectors starting with :type.
22:19jeayeI think a library like specter can do this, but I was looking for a built-in function first.
22:20Frozenlockjeaye: There's nothing built-in for this (to my knowledge). Tho clojure.walk would probably be a good place to start if you don't mind building it yourself.
22:21jeayeI'd rather bring in specter than bother writing it myself. Thanks, Frozenlock.