#clojure logs

2014-10-29

00:00justin_smithnumberten: oh, agent uses nprocessors+2 as well
00:00numbertenmagic number I guess
00:00bbloompuredanger: are you saying you can always use two more threads?
00:00bbloomheh
00:00puredangerexactly
00:00justin_smithnumberten: it's core.async that multiplies by two and then adds 42 https://github.com/clojure/core.async/blob/aefbe7ad7e68f89f2ca584cd2fcd1bdf6fe8a601/src/main/clojure/clojure/core/async/impl/exec/threadpool.clj
00:01justin_smithI was misremembering
00:01numbertenthat's also weird..
00:01clojurebotTitim gan éirí ort.
00:01justin_smith~that
00:01clojurebotthat is not the forget syntax
00:01justin_smithhow meta, clojurebot
00:02numbertenwhat does ~ do for clojurebot?
00:02joshhead*2 then +42? that seems pretty arbitrary
00:02justin_smithnumberten: it asks him for a factoid
00:02justin_smith~factoid
00:02clojurebotExcuse me?
00:02numberten~justin_smith
00:02justin_smith~botsnack
00:02clojurebotjustin_smith is sits on a throne of lies
00:02clojurebotThanks! Can I have chocolate next time
00:03numbertenheh
00:03justin_smithnumberten: a youthful indescretion preserved for all time, or until the sqlite db holding the factoids gets wiped
00:03TEttinger~ask
00:03clojurebotThe Ask To Ask protocol wastes more bandwidth than any version of the Ask protocol, so just ask your question.
00:04justin_smithbodie_: https://github.com/swannodette/om/wiki/Cursors is the doc I found
00:14bbloomjustin_smith: i think i'm going to abuse Rhino, since it has a js parser and code generator... although it's private impl details i may have to hack around to get at
00:26justin_smithbbloom: interesting
00:27justin_smithwhat's the default equality method that #{} uses?
00:27justin_smithit seems not to be .equals
00:27justin_smith,(deftype Tuple [a b] Object (equals [this other] (and (= (.a this) (.a other)) (= (.b this) (.b other)))) (toString [this] (str "<" (.a this) "," (.b this) ">")))
00:27clojurebotsandbox.Tuple
00:28justin_smith,(into #{} [(Tuple. 0 0) (Tuple. 0 0) (Tuple. 0 0)])
00:28clojurebot#{#<Tuple <0,0>> #<Tuple <0,0>> #<Tuple <0,0>>}
00:28justin_smith,(apply = [(Tuple. 0 0) (Tuple. 0 0) (Tuple. 0 0)])
00:28clojurebottrue
00:28justin_smithI implemented equals, = returns true, but a set doesn't consider them unique
00:29justin_smith*identical
00:38amalloyjustin_smith: you didn't implement hashCode
00:38justin_smithamalloy: yeah I figured it out http://stackoverflow.com/questions/26622511/clojure-value-equality-and-sets/26622863#26622863
01:48BalvedaSay I've got a map like so
01:48Balveda{:names [{:surn "A" :givn "B"} ... {:surn "X" :givn "Y"}]}
01:50justin_smithOK
01:52eggheadvery nice Balveda
01:52Balveda-2huh, I cut out
01:52egghead:)
01:52BalvedaAnyways, yeah
01:53BalvedaI've been having some issues with a function because of that for a week or so and through some debugging I found out that what is wrong is that I'm doing (map-indexed list x-map) and that just gives me one item with everything in it
01:54justin_smithBalveda: I think I did not see the "because of that" you refer to
01:54nathan706:47:50 < Balveda> {:names [{:surn "A" :givn "B"} ... {:surn "X" :givn "Y"}]}
01:54nathan7that's all we got
01:54BalvedaAH
01:54Balveda<Balveda> I want map-indexed to get me 0 {:surn "A" :givn "B"} 1 {:surn "C" :givn "D"} etc
01:54Balveda<Balveda> What fn could I feed it?
01:54BalvedaThen everything else
01:55BalvedaMy connection's being pretty terrible today unfortunately
01:55eggheadBalveda: i think you're looking for update-in ?
01:55justin_smith,(map-indexed list (:names {:names [{:surn "A" :givn "B"} {:surn "X" :givn "Y"}]}))
01:55clojurebot((0 {:surn "A", :givn "B"}) (1 {:surn "X", :givn "Y"}))
01:55Balvedahm..
01:57Balveda-2I'm actually doing something like that but it's not quite doing this
02:01Balvedajeez
02:01Balvedaanyways
02:01BalvedaI saw your code, justin_smith, and I am actually doing something like that
02:01BalvedaIt's all in cljs, Hoplon in particular
02:01justin_smithOK
02:02Balvedabut the functionality should be similar
02:02justin_smithright, all of that above should just work in cljs
02:09vIkSiThello all
02:09vIkSiTI have a fn that takes a few args : (myfn a b c :k v :k2 v2 ... )
02:10vIkSiTin general, the v can be another complex structure
02:10vIkSiTeg
02:10vIkSiT:k {ns2/myfn {:k' :v' ... })
02:10vIkSiTId like to create a macro that allows me to return the args portion that are key/vals
02:10vIkSiTso
02:10vIkSiT(myfn a b c (mymacro))
02:10vIkSiTshould give me
02:11vIkSiT(myfn a b c :k v :k1 v1 ...)
02:11vIkSiThow would I do this?
02:11vIkSiTAs you might imagine, these key values need to be constructed piecemeal based on input and i'd like to abstract it out from myfn
02:11vIkSiTideas?
02:12justin_smithare all of those instances of myfn the same function?
02:12vIkSiToh sorry no
02:12vIkSiTthat should be (ns2/anotherfn)
02:13vIkSiTI guess what I can't figure out is - what should be the return type of this macro/function that returns these kv pairs?
02:13justin_smithvIkSiT: macros cannot transform an outer form
02:13justin_smiththey only transform what is inside them
02:13justin_smithnot what wraps them
02:13vIkSiTright
02:14vIkSiTI guess my question is more on - if I have to call (myfn a b c & args)
02:14vIkSiThow do I get these args from some function
02:14justin_smithapply
02:14vIkSiThmm
02:15vIkSiTwhat's a good example?
02:15vIkSiT(defn myfn [a b c & args]
02:15vIkSiT (prn a b c args))
02:16vIkSiT(myfn 1 2 3 :k1 'v1 :k2 'v2) -> 1 2 3 (:k1 v1 :k2 v2)
02:16justin_smith,(apply (fn [& {:keys [a b c]}] [c b a]) (apply concat {:a 0 :b 1 :c 2}))
02:16clojurebot[2 1 0]
02:16justin_smiththe extra apply concat is because & {:keys ...} sucks
02:16vIkSiTsorry whats going on here again?
02:17justin_smith,(def args{:a 0 :b 1 :c 2})
02:17clojurebot#'sandbox/args
02:17justin_smith,(defn dothing [& {:keys [a b c]}] [c b a])
02:17clojurebot#'sandbox/dothing
02:17justin_smith,(apply dothing (apply concat args))
02:17clojurebot[2 1 0]
02:17vIkSiTah hmm
02:18justin_smithor you could just not use & {:keys ...}, and everything is suddenly much simpler
02:19vIkSiTsadly its not my function. library
02:19justin_smithvIkSiT: the apply concat is needed to put the map in the shape that & {:keys ...} needs
02:20vIkSiTjustin_smith, trying to wrap my head
02:21vIkSiTso what happens when dothing has [a b c & args]
02:21vIkSiThow would I use it?
02:21justin_smith(apply dothing a b c (apply concat args))
02:21justin_smith(if args is a map)
02:21justin_smith,(apply + 1 2 3 [4 5 ])
02:21clojurebot15
02:22justin_smithonly the last arg is unwrapped, the rest are used as normal
02:23vIkSiThmm
02:29vIkSiTjustin_smith - one issue here
02:29vIkSiT(apply concat mymap)
02:29vIkSiTgives (:k1 v k2 v...)
02:29vIkSiTits a list
02:29vIkSiTwhereas what I want is the values themselves
02:29justin_smithjust the values?
02:30vIkSiT,(defn myfn [a b c & args]
02:30vIkSiT (prn a b c args))
02:30clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
02:30justin_smithuse vals then
02:30vIkSiTsorry I mean
02:30vIkSiT(apply myfn 1 2 3 (flatten (apply concat {:k1 1 :k2 3})))
02:30vIkSiT1 2 3 (:k1 1 :k2 3)
02:30justin_smith,(vals {:a 0 :b 1 :c 2 :d 4})
02:30clojurebot(2 1 4 0)
02:30vIkSiTbut I want
02:30justin_smithyou don't need flatten
02:30vIkSiT1 2 3 :k1 1 :k2 3
02:31justin_smithvIkSiT: that is the point of apply
02:31justin_smithvIkSiT: you can't alter the args to myfn inside one of its args, that's just not a thing
02:31clojurebotI don't understand.
02:31justin_smithso you use apply
02:31vIkSiThmm
02:32justin_smiththere is no way to wrap your map such that it alters the arg list - but apply will construct a new arg list
02:32justin_smithand also, that flatten is not needed, and can break things
02:32justin_smith~flatten
02:32clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
02:32justin_smithI've never actually ever needed flatten
02:35justin_smithvIkSiT: is the issue you are describing with myfn that you want myfn to make a single collection of all its args?
02:35vIkSiTi'm just wrapping my head around how this apply is working with the concat map
02:35vIkSiThmm
02:35justin_smith(defn otherfn [a b c & args] (println (conj args c b a)))
02:35justin_smith,(defn otherfn [a b c & args] (println (conj args c b a)))
02:35clojurebot#'sandbox/otherfn
02:36justin_smith,(apply otherfn 1 2 3 [4 5 6])
02:36clojurebot(1 2 3 4 5 ...)\n
02:36justin_smith,(defn otherfn [a b c & args] (apply println (conj args c b a)))
02:36clojurebot#'sandbox/otherfn
02:36justin_smith,(apply otherfn 1 2 3 [4 5 6])
02:36clojurebot1 2 3 4 5 6\n
02:36vIkSiTaah
02:36vIkSiTgot it
02:37vIkSiTthanks justin_smith - that was super helpful :)
02:37justin_smiththese also work:
02:37vIkSiThmm?
02:37justin_smith,(otherfn 1 2 3 4 5 6)
02:37clojurebot1 2 3 4 5 6\n
02:37vIkSiTah
02:37vIkSiTyes
02:37vIkSiTI understand how apply works now
02:38justin_smith,(apply otherfn [1 2 3 4 5 6])
02:38clojurebot1 2 3 4 5 6\n
02:38justin_smith,(apply otherfn 1 [2 3 4 5 6])
02:38clojurebot1 2 3 4 5 6\n
02:38justin_smithetc. etc.
02:38vIkSiTah
02:39vIkSiTmakes sense
02:40zRecursive,(doc ->)
02:40clojurebot"([x & forms]); Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc."
02:41justin_smithzRecursive: something that really helps with -> is using macroexpand
02:42zRecursive,(macroexpand ->)
02:42clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/->, compiling:(NO_SOURCE_PATH:0:0)>
02:42justin_smith,(macroexpand '(-> 1 inc (println "is the number")))
02:42clojurebot(println (inc 1) "is the number")
02:42vIkSiToh nice trick
02:42zRecursivegreat!
02:47justin_smithanyway, I'm staying logged in but turning in for the night, see you all later
02:48Balveda-2(inc justin_smith)
02:48lazybot⇒ 107
02:49fairuz(+ 1 2)
02:49clojurebot3
03:16rurumateIs defrecord "discouraged"?
03:20arrdemrurumate: in what sense?
03:20arrdemrurumate: defrecord and deftype are not tools one typically reaches for right away if that's what you mean
03:20arrdemrurumate: but they are working tools to be used when appropriate
03:25rurumatearrdem: The reader can not read records. When performance is not critical, should hash maps always be preferred? Records are also often used with protocols. Is it preferable to use defmulti / defmethod, and a dispatch field in hash maps instead? I'm looking for the best practice way here.
03:28arrdemrurumate: maps represent arbitrary mappings... for small symbolic mapings records or types are intended to do better
03:28arrdemrurumate: the "best practice" is to prototype everything with plain maps, get that working and then use records if there is a gain from doing so
03:29rurumateAlso, what happens when you have a record based protocol, and then use standard functions like assoc on your records. That can have unexpected results, because it converts the record to a map, and then the the correct dispatch of the prototype may not trigger. It seems that this can lead to subtle bugs and brittle code
03:30arrdemrurumate: no records are maps and remain records if you assoc or dissoc on them
03:30rurumate*dispatch of the protocol may not trigger
03:30arrdemif you merge on a record you can discard the record class and get a map back, but that's sketchy anway
03:33rurumateI think records are mostly awkward to work with
03:33rurumatemore awkward than regular maps, anyway
03:33arrdemthat's definitely true
03:34arrdembut maps are a less complex tool and are generally preferred so you shouldn't be surprised.
03:35yekKhasteHi
03:35yekKhasteIs clojure good for rapid web development?
03:36yekKhasteClojure can compare to something link rails for rapid web development?
03:39rurumateyekKhaste: it's a lisp, so it should be good for pretty much anything
03:39yekKhasterurumate, Has it any full stack web framework that can compare to rails?
03:39arrdemyekKhaste: no
03:39rurumatethere are some web frameworks, but I'm no authority on that. I doubt it has something as mature as rails
03:40arrdemrurumate: maturity I would debate, we certainly have no monolitic web platform ala rails
03:40rurumateit's what I meant to say
03:41yekKhasteAnd do you recommended clojure for freelancer developers?
03:41arrdemI have freelanced with Clojure successfully before...
03:41arrdemmany Clojure shops are contractors
03:41rurumateif you sell the source code to the client, better ask them if they want to maintain that
03:42yekKhasteActual I am looking for some modern tool for rapid backend development
03:43yekKhasteI what too know cant I use clojure or not
03:44arrdemI don't think there's any way we can reasonably make that assessment for you
03:44arrdemI've used Clojure to build websites and contract as have others...
03:44arrdemit can be done
03:44arrdemwhether it's appropriate for you... who knows
03:44yekKhastearrdem, Thanks alot
03:45arrdemyekKhaste: sorry, that's the most helpfull answer I can give :/
04:16sm0ke,(def a (atom (proxy [Object] [] (finalize [] (println "OK gcd..")))))
04:16clojurebot#'sandbox/a
04:16sm0ke,(reset! a nil)
04:16clojurebotnil
04:16sm0ke,(System/gc)
04:16clojurebotnil
04:16sm0kecan someone tell why it is not gc'd
04:17hyPiRionsm0ke: you'd probably need to run the gc 4-5 times
04:18sm0keran it 40 time
04:18sm0kenothing
04:18hyPiRionhm
04:19sm0ke,(repeatedly #(System/gc))
04:19clojurebot(nil nil nil nil nil ...)
04:19sm0keno helo
04:19sm0keno help either
04:20opqdonutsm0ke: a) there's no guarantee on running finalizers timely b) even if the finalizer was run, clojurebot might not print the line
04:20sm0keopqdonut: i obviously was testing this on my machine!
04:20opqdonutthat's what I thought :)
04:21hyPiRionwell. The JVM doesn't guarantee that finalize is called on an object, so.
04:23yocapybaraguys I'm being a dufus. Say I'm (/ 4 3) dividing 4 by 3, and I want to get 2 so to round up to nearest integer, I can't use quot as that rounds down, anything easy out of the box? or do I have to bring in BigDecimal?
04:23sm0kewow, so i need to create a Java class to prove this now
04:24pyrtsasm0ke: As nice as it would be, finalisers are not the way to deal with automatic cleanup of non-memory resources in Clojure.
04:24pyrtsa,(with-open [_ (reify java.lang.AutoCloseable (close [_] (println "closed")))] (println "working on it..."))
04:24clojurebot#<CompilerException java.lang.ClassNotFoundException: java.lang.AutoCloseable, compiling:(NO_SOURCE_FILE:0:0)>
04:24pyrtsaDoh.
04:24pyrtsa,(with-open [_ (reify java.io.Closeable (close [_] (println "closed")))] (println "working on it..."))
04:24clojurebotworking on it...\nclosed\n
04:25sm0kepyrtsa: i have a kind of situation where i cannot use with-open
04:25pyrtsaMacros (e.g. with-open) could be a way around it, though.
04:25pyrtsaElaborate?
04:25opqdonut,(let [obj (proxy [Object] [] (finalize [] (println "OK gcd..")))] (.finalize obj))
04:25clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: finalize for class sandbox.proxy$java.lang.Object$ff19274a>
04:25amalloysm0ke: *out* is not bound to anything while you're running a finalizer
04:25opqdonut^ that's fishy
04:25opqdonutamalloy: ah of course
04:25opqdonutrun by the finalizer thread
04:25pyrtsaamalloy: Wow, didn't know!
04:26pyrtsa(inc amalloy)
04:26lazybot⇒ 181
04:26sm0keok then
04:26hyPiRionyocapybara: (defn div-up [a b] (quot (+ a b -1) b))
04:26sm0ke,(def b (atom 1))
04:26clojurebot#'sandbox/b
04:26sm0ke,(def a (atom (proxy [Object] [] (finalize [] (swap! b inc)))))
04:26clojurebot#'sandbox/a
04:26hyPiRionamalloy: I tried setting an atom. No response there either.
04:26sm0ke,(reset! a nil)
04:26clojurebotnil
04:27sm0ke,(repeatedly 100 #(System/gc))
04:27clojurebot(nil nil nil nil nil ...)
04:27sm0ke,@b
04:27clojurebot1
04:27amalloyopqdonut: i doubt if you're allowed to call finalize yourself. it's a protected method
04:27sm0kewell
04:27sm0ke,(repeatedly 100 #(System/gc))
04:27clojurebot(nil nil nil nil nil ...)
04:27sm0ke,@b
04:27clojurebot1
04:28yocapybarahyPiRion: that is intruiging, feel like my mind is turning to mush as I get older! - thanks, going to play in a repl
04:29yocapybaraman I totally would have never have come up with that, I need to go back to junior high and retake math classes
04:29sm0ke,(repeatedly 100 #(System/gc))
04:29clojurebot(nil nil nil nil nil ...)
04:29sm0ke,@b
04:29clojurebot1
04:30sm0kei am going to keep doing this unless java gives up...you stuPUID JAAVvaaaVAa
04:30amalloysm0ke: do it in your own repl. nobody needs to see that pasted here over and over
04:30sm0ke:)
04:31sm0kei think its a problem with proxy
04:31amalloyalso, like...who cares? finalizers are a disastrous antipattern; no correct program can rely on finalizers ever being run: http://blogs.msdn.com/b/oldnewthing/archive/2010/08/09/10047586.aspx
04:31amalloyit's a curiosity, of course, and i'd like to know why this isn't working here
04:32amalloybut cursing java seems like the wrong approach: any resolution you get here isn't really going to help you write a better program, as much as taking some other approach would help
04:33hyPiRionyocapybara: np – It's probably because I've tried to do round up integer divisions in the past :)
04:33yocapybarahyPiRion: I'm doing it in excel on loads of numbers to try to figure out what sorcery it is, man to think I used to do pages and pages of math in school :)
04:34hyPiRionIt's not entirely foolproof though. I think I'd only use it for positive numbers.
04:35yocapybarahyPiRion: that's the context in which I'm using it so that's great
04:37ro_stusing logback, i'd like to put everything in our code in one file, except for a couple namespaces, which i'd like to log to a different file. does anyone perhaps have an example logback.xml with this situation?
04:38hyPiRionyocapybara: Another way to write it is (+ 1 (quot (- a 1) b)) if that helps your understanding better.
04:38hyPiRionI think it should be easier to "see" why that one works
04:41yocapybarahyPiRion: thanks :) will put that alongside, yes I think I can already see that one more
05:19justin_smithrurumate: the reader can read records
05:30justin_smith,(defrecord Foo [x y])
05:30clojurebotsandbox.Foo
05:30justin_smith,(Foo. 0 1)
05:30clojurebot#sandbox.Foo{:x 0, :y 1}
05:30justin_smith,(= #sandbox.Foo{:x 0 :y 1} (Foo. 0 1))
05:30clojurebot#<RuntimeException java.lang.RuntimeException: Record construction syntax can only be used when *read-eval* == true>
05:30justin_smithbleh
05:31justin_smithanyway, it can be read
05:31justin_smith(require '[clojure.edn :as edn])
05:31justin_smith,(require '[clojure.edn :as edn])
05:31clojurebotnil
05:32justin_smith,(edn/read-string "#sandbox.Foo{:x 0 :y 1}")
05:32clojurebot#<RuntimeException java.lang.RuntimeException: No reader function for tag sandbox.Foo>
05:38justin_smithrurumate: this stuff doesn't work with clojurebot, but it all works in a standard clojure process / project, including reader literals in files
05:40rurumatejustin_smith: thanks
05:41dannershey what is the best free tutorial for clojure, assuming no previous functional expericence ?
05:42scottjdanners: braveclojure.com is the most popular one recently
05:44dannersscottj: thanks
05:49dysfunhi all. i'm building a securitymanager that prevents user-provided code from being naughty. where naughty is largely defined as "can open files, use the network, generally perform I/O". obviously i can only lock on a class level. is there any wider mechanism for banning those operations?
05:50sm0kedysfun: best would be to sandbox the process imo
05:51sm0keor you can take a look at ##(File. "ssss")
05:51lazybotjava.lang.IllegalArgumentException: Unable to resolve classname: File
05:51sm0ke,(java.util.File. "aaa")
05:51clojurebot#<CompilerException java.lang.ClassNotFoundException: java.util.File, compiling:(NO_SOURCE_PATH:0:0)>
05:52sm0kewowsad
05:52sm0ke,(java.io.File. "aaa")
05:52clojurebot#<File aaa>
05:52sm0kehurmm oh
05:53dysfunexactly
05:53dysfunand let's not forget java.nio.* either
05:54sm0kewell File is just logical unless you do some operations further
05:54sm0ke,(slurp "/etc/hosts")
05:54clojurebot#<SecurityException java.lang.SecurityException: denied>
05:54sm0kesee
05:55dysfunyes, but how much is that restricted? can i for example check the existence of a file or read the contents of a directory?
05:57dysfunand where is the source for the bot's sandbox?
05:59justin_smithboth clojurebot and lazybot are on github
05:59dysfunwhose account?
05:59justin_smith$google github lazybot clojure
05:59lazybot[Raynes/lazybot · GitHub] https://github.com/Raynes/lazybot
05:59justin_smith$google github clojurebot
05:59lazybot[hiredman/clojurebot · GitHub] https://github.com/hiredman/clojurebot
06:00dysfunsweet
06:09hugodbbloom: stevedore was originally based on https://github.com/arohner/scriptjure
08:29jonathanjis there really no shorter way of writing (assoc xs (dec (count xs)) (str ":" (peek xs)))?
08:29jonathanjhaving to repeat "xs" three times seems crazy
08:30clgvjonathanj: time to write a function ^^
08:30clgvjonathanj: create a my-project.tools namespace and put that helper function there
08:32clgvjonathanj: e.g. (defn update-last [xs f & args] (apply update-in xs [(dec (count xs))] f args)) usable as (update-last [0 1 2] #(str ":" %))
08:33clgv,(defn update-last [xs f & args] (apply update-in xs [(dec (count xs))] f args))
08:33clojurebot#'sandbox/update-last
08:33clgv,(update-last [0 1 2] #(str ":" %))
08:33clojurebot[0 1 ":2"]
08:41clgvwhat is the recommended setup for tagged literals? such that they are usable in repl as well as in a standalone uberjar?
08:53dysfunthe clojurebot sandbox. is the reason that it gets the parent of clojure.lang.RT's classloader so that it can load another version of clojure/
08:55dysfunsorry, not the clojurebot sandbox, classlojure
08:57clgvdysfun: what is the context question?
08:57clgvdid they fix the memory leaks in classlojure yet?
08:58dysfuni have no idea. i haven't used classlojure before
08:58clgvhumm 1 year no change - so I guess not
08:58dysfunthe problem i'm trying to solve is loading plugins written in approximately any jvm language
08:58dysfunclasslojure's code looks relatively straightforward to sort the classloader/only-load-from-this-jar problem
08:58dysfunthe securitymanager, well, that's going to be tedious, i have no doubt
08:59dysfunhowever, i'm curious why they're doing a .getParent on clojure.lang.RT's classloader. the only reason i can think they would is because they explicitly advertise loading other versions of clojure
08:59clgvdysfun: there is clojail for the security stuff. it includes functions to configure jvm security mechanisms as well
09:00dysfunyes, i'm aware of clojail, but it seems targeted mostly at securing clojure, so we'll see how that one pans out
09:00clgvyeah but that includes the usual jvm stuff, afair
09:00dysfun*nod*. as i say, we'll see how it pans out
09:01dysfunif i can reuse it, of course i'm thrilled to not have to do the tedious stuff
09:01clgvI think it's mostly specifying white lists of what is allowed
09:03clgvdysfun: be aware that you can only spin up a small number of classlojure classloaders due to memory leaks, when you use classlojure
09:03clgvdysfun: I tried that a while back
09:03dysfuni am not using classlojure
09:03clgvok ^^
09:04dysfunmostly because the actual part that i need is several lines of code
09:04clgvapplies when loading custom clojure version in any classloader as well
09:04dysfuni don't intend to support that model. at least not just yet
09:04clgvat least for versions before 1.6
09:04dysfuni'll probably support loading 1.6 when 1.6.1 comes out
09:04dysfunbut i can't see it actually breaking anything
09:05clgvhuh? 1.7 will be next ;)
09:05dysfunoh
09:05dysfunin any case, i certainly have no intention of supporting clojure < 1.6
09:06dysfuni expect most of the plugins i'm loading will be java anyway
09:38nicolaHi, how to wrap InputStream into async channel?
09:42ohpauleeznicola: In the labs namespace, there's a function called `spool`that puts a sequence onto a channel
09:42ohpauleezyou can get a sequence from the inputstream and spool it onto the channel: https://clojure.github.io/core.async/#clojure.core.async.lab/spool
09:43ohpauleezIf you want to push an inputstream directly onto a channel without the extra allocations, you'll need to implement a new input stream that is passed the channel in the constructor
09:45ApeShotSo I am having a very mysterious error in a clojure project: lein compile has suddenly started failing with a null pointer exception and all it tells me is that it is on core.clj:1
09:45ApeShotNo information about which core (of which there are many)
09:45teslanickDoes onto-chan not work with seqs?
09:45ApeShotHow can I cajole lein into compiling one file at a time
09:45ApeShotOr get it to give me more verbose output
09:47nicola@ohpauleez thx
09:48ohpauleeznicola: teslanick: Good question - It should. spool can consume a lazy seq though (iirc), without realizing the entire seq
09:48clgvApeShot: do you have a :main namespace?
09:48nicola@ohpauleez i want run long shell command and >! progress into channel
09:49teslanickohpauleez: I hadn't thought of putting an infinite seq on a channel, but I can see why that would be useful.
09:49ApeShotMaybe I accidentally deleted it?
09:49ApeShotIt is a play-clj template
09:49ApeShotSo there is some magic I don't get
09:50ApeShotBut i've been working and building the project successfully for quite some time
09:51clgvApeShot: it is probably the core.clj in your project since you cant change those of the dependency libraries
09:51ohpauleeznicola: Yep, use `line-seq` and the io/reader. Then use spool with that seq and you should have what you're looking for
09:54ApeShotclgv: the play-clj template and usage doesn't have you define the main ns yourself
09:55clgvApeShot: you didn't use a VCS by any chance?
09:55the_dankowow, just getting to macros in brave clojure! sweeet!
09:56mikepenceoh, yeah
09:56mikepencehey, I am doing a presentation to our local Java UG tonight re: fp and clojure
09:56mikepencelooking for some sample code to share, something public on github
09:56mikepencereal-worldish
09:56mikepencenot fib seq or other minimalist stuff
09:57ApeShotI hadn't yet put in a git repo
09:57ApeShotI know, stupid
09:57clgvApeShot: then it would be a matter of a view minutes to find that error ;)
09:57clgv*few
09:58ApeShotclgv: That was the first thing I checked, and then remembered that I had been programming without a net
09:58ApeShotI have a back up that is a day old
09:58ApeShotWhich still compiles
09:58ApeShotSo I can laborously do ugly diggs
09:58ApeShotdiffs
09:59ApeShotBut I figured someone else might have an idea about how to target that search
09:59ApeShotLooking for the main ns might be the thing
09:59clgvApeShot: you can use "meld" or similar to compare the whole project directories
09:59ApeShotI don't know how I could have messed it up
09:59clgvApeShot: well not without seeing the code...
10:02ApeShotOk, so my project.clj has a line : :main all-ghosts-vs-all-skeletons.core.desktop-launcher
10:03ApeShotAnd indeed this is the entry point of the project and it exists
10:03japromaybe that is a Halloween joke :o)
10:04japrooh wait, that is your project name i guess... nvm
10:04clgvApeShot: on rethinking it that really does not matter, find the core.clj you wrote yourself
10:05ApeShotI have many
10:05ApeShotFor different modules of the project
10:05clgvyou have many core.clj in one project? O_o
10:05stuartsierraApeShot: Comment out `:main`, do `lein clean`, start a REPL and `require` your namespaces one by one.
10:05ApeShotI know with each line my failure to use git makes me look dumb
10:05CookedGryphonWhat are people's opinions on side-effecting actions in transducers?
10:05ApeShotI'm sort of new to how people organize clojure projects, but mine has a variety slightly coupled components parts, each of which has a directory and a core
10:06CookedGryphonI'm re-writing a number of go-loops in my code to simply use transducers and pipes, which is fine for all the functional transformations that push on a different value down a different channel... but some of the go loops were listening to events and then acting as a result...
10:06CookedGryphonif I follow the pattern of converting to transducers, that means a side-effecting map
10:07CookedGryphonbut leaving it as go-loops bugs me in other ways (not composable, etc)
10:07TimMcclgv: ++ for meld
10:07clgvTimMc: :D
10:07clgvif you can afford it, BeyondCompare is nice as well
10:10stuartsierraCookedGryphon: Transducers are evaluated "eagerly" so side-effects are generally less of a problem than they would be with lazy-seqs.
10:14hyPiRionstuartsierra: huh? I was under the impression that transducers doesn't enforce strictness nor laziness. Or perhaps that's why you wrote "eagerly".
10:15CookedGryphonstuartsierra: yeah, this was my quandry, I know that in this case it would work, but is it encouraged, or is there a better way to separate out the side effecty stuff...
10:15stuartsierrahyPiRion: Yeah, it depends on how you "consume" them.
10:15rurumateCookedGryphon: can you paste an example of how you're rewriting the go-loops using transducers? I'd like to see that thanks
10:15stuartsierraLike how I'm giving "advice" right now.
10:15hyPiRionright
10:16CookedGryphonor is it just a case of, I'm using it on a channel, I can expect it to process as it goes
10:16CookedGryphonsure, I'll try and pick a good example
10:17stuartsierraCookedGryphon: While I wouldn't necessarily say it's "wrong" to have a side-effect in a transduced process, I would be more inclined to try to isolate the side effects at the "end" of the process.
10:18CookedGryphonstuartsierra: indeed, and that's actually what's happening here
10:18CookedGryphon*but* I have an ulterior motive
10:18stuartsierraA side effecting fn can be passed to `run!` or used as the "sink" from a channel.
10:18CookedGryphonwhich is to reduce the number of namespaces depending on core.async macros, because it's a pain re-using the code in clojurescript
10:19CookedGryphonare you referring to a library fn run!, or is that a hypothetical fn I should write?
10:19BronsaCookedGryphon: it's a new 1.7 function
10:19Bronsa,(doc run!)
10:20clojurebot"([proc coll]); Runs the supplied procedure (via reduce), for purposes of side effects, on successive items in the collection. Returns nil"
10:20CookedGryphonwill that work with core.async channels?
10:20puredangerif you do channel things in it, that should be fine
10:21puredangerit doesn't know anything specifically about channels
10:22CookedGryphonother way round, I'm talking about doing a side effecting function for things being outputted from a channel
10:22CookedGryphonI don't think run helps me here
10:22puredangerno, don't think so
10:24puredangerso I guess you can't use a thread if you want this to work in cljs too
10:24puredangerseems like a go loop is probably your best bet in that case?
10:24CookedGryphonso yeah, *without macros* (i.e. just using pipes, transducers and other composable channel operations), what's the nicest way of having a sink function
10:25CookedGryphonwhich just does a side effecting thing on each element as it comes out of the channel
10:25puredangerisn't that obvious to write in a go loop?
10:25CookedGryphonyeah, and I wrote it the obvious way first time around
10:26CookedGryphonnow it's structurally bitten me as none of the go-loop code is re-usable, adding functionality bloats the go loops because they're not composable
10:27CookedGryphonbut this may well be one case where it's reasonable to leave it as a go loop
10:27puredangerI would try to put as little code as possible in the go loop and just keep it to primarily doing channel things and control flow
10:27CookedGryphonyep, which is exactly what I did
10:28CookedGryphonand I ended up with 4 lines of boilerplate for everything I wanted to do with go-loops
10:28CookedGryphonnow I've rewritten most of the take a thing from these pipes, combine and put out to that pipe
10:28CookedGryphonas transducers and pipe operations
10:28CookedGryphonand it's lovely and concise
10:28CookedGryphonand composable
10:29CookedGryphonand so I'm exploring other options for this end point which takes a side effecting action on each item coming out of the channel
10:29CookedGryphonto see if there's a similar gain to be made
10:30CookedGryphonthis rewrite also means I have taken the core.async dependency out of a lot of namespaces entirely, they just produce a transducer
10:30puredangerthere definitely is a missing "sink" operation in core.async - there's a ticket for this out there
10:30CookedGryphonand the fact that it goes via async channels is now a detail which the caller is responsible
10:30CookedGryphoncool, I'll have a look and upvote it if I find it
10:31puredangerhttp://dev.clojure.org/jira/browse/ASYNC-67
10:32CookedGryphonYeah, that
10:32CookedGryphonIn fact, I might just take that into my code as a utility
10:37stuartsierrapuredanger: thanks for that link
10:40puredangerwe are trying to bring async tickets into the same review process we use for Clojure itself but that has been slow to take hold
10:41Bronsapuredanger: I thought the point of contribs was to have a faster contribution process than clojure?
10:41puredangerasync is special
10:42puredangerbut it can also have releases independent of Clojure
10:42puredangerand that's actually why it's hard to integrate - the reports are focused around a target release and those dimensions differ between core and async
10:42puredangerI'm still trying to decide exactly how to deal with that
10:43puredangerit's possible that some of async could move into core in the future. I'm not foretelling anything… just saying that's a possibility.
10:44Bronsaclojurebot: core.async |is| special
10:44clojurebot'Sea, mhuise.
10:44puredangermy personal opinion is that async is important enough to be in the box. but I also think it's still changing enough that I'd like to be able to release separately and more frequently. just my opinion / not speaking for Rich or anything official.
10:45Bronsapuredanger: ok, thanks
10:46ssacan you not `import` in the body of a namespace?
10:46Bronsasure you can ssa
10:46Bronsa,Buffer
10:46clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: Buffer in this context, compiling:(NO_SOURCE_PATH:0:0)>
10:47Bronsa,(import 'java.nio.Buffer)
10:47clojurebotjava.nio.Buffer
10:47Bronsa,Buffer
10:47clojurebotjava.nio.Buffer
10:47Bronsa^
10:47ssacool, ok -- i am doing the following but am getting an exception:
10:47ssa(import 'org.apache.curator.retry.BoundedExponentialBackoffRetry)
10:47ssa(BoundedExponentialBackoffRetry. 100 120000 10)
10:47Bronsassa: what's the exception?
10:47ssaUnable to resolve classname: BoundedExponentialBackoffRetry
10:48borkdudeobject oriented programming: the blind leading the blind (haha, sorry, just wanted to rant)
10:48Bronsassa: is the import statement in the top-level?
10:48ssaalso happens when i do (import [org.apache.curator.retry BoundedExponentialBackoffRetry])
10:48ssano
10:48ssait's in a function
10:48Bronsassa: that's your issue
10:48ssaah awesome -- what's going on?
10:49Bronsassa: import works at runtime, class literals are resolved at compile time
10:50Bronsassa: also in your second import example, you're missing the quote
10:51Bronsassa: remember require/import/use & co are functions so when you're using them outside the ns macro, you need to quote the args
10:51ssaBronsa: ah yes, got it
10:52ssato describe what I'm trying to do: I want to make a retry policy configurable, and don't want to import unnecessary classes
10:52ssaie, didn't want to import all retry policies
10:59mavbozossa: if you know which classes that you will eventually use, why not import them all?
10:59mavbozossa: any particular restriction from environment?
11:00ssamavbozo: maybe I am wrong here; I am running that snippet of code in a prismatic graph node, which I am using as a config
11:01ssamavbozo: ie, I know a retry policy will be specified by the user, but I don't know which one
11:01ssamavbozo: is there no cost to importing everything?
11:03mavbozossa: jvm will use more Permanent Generation memory
11:04mavbozossa: but you can see the usage from, for example, jconsole
11:10puredangerin <= Clojure 1.6, importing a class will also cause it to be loaded, which is in some cases problematic
11:11puredangerthat behavior is actually changing in 1.7
11:11puredangerhttp://dev.clojure.org/jira/browse/CLJ-1315
11:11ApeShotSo the issue I mentioned above is quite mysterious
11:11ApeShotI commented out everything except for a naked skeleton in my entry point
11:11ApeShotAnd then it compiled
11:12ApeShotI gradually added everything back until it was at the original state and all compiled
11:12ApeShotI then did lein clean && lein build and I get the null pointer problem
11:12ApeShotexcuse me, lein run
11:12ApeShotTo make it go away, I have to comment everything out again, lein run, then uncomment out and lein run
11:12ApeShotIt runs fine when it builds
11:12ApeShotno errors
11:13ApeShotBut it seems that after a lein clean I must go through this ritual of commenting down to a trivial version
11:13ApeShotAnd then building, and then uncommenting out my code
11:13ApeShotDoes this ring any bells with anyone?
11:13sdegutisHi. What's a good local file backup setup for local files, including closed source Clojure repos?
11:13ApeShotSounds like some stile class files are hanging around or something
11:13sdegutisI know redundancy is important, and I've heard the word RAID tossed around...
11:14mavbozoApeShot: i remember a discussion a few months ago here. someone solve that kind of problems just by creating a new directory and copy every file to the new directory
11:16ApeShotmavbozo: I sort of did that. I might create a clean structure from the same template and copy the files in
11:16ApeShotSee if that helps
11:16clgvApeShot: sounds more like your project is somehow relying on stub class files that are not around after "lein clean"
11:16clgvApeShot: thats theological computer science then ;)
11:16ApeShotclgv: how might I figure out where those classes are, then?
11:16ApeShotclgv: or what sort of code might generate them?
11:17clgvApeShot: does the documentation of the libraries/frameworks you use state that some namespaces need to be AOT compiled?
11:17ApeShotclgv: this is for a game jam ending on the 31st, so I am not above computer science theology
11:17ApeShotI'm just using play-clj
11:18ApeShotAnd my own library cljan, which doesn't do anything fancy
11:18ApeShotWell, it does fancy things, but not so far as the administration of the project is concerned
11:18ApeShotNothing in the play-clj docs indicates any such thing
11:19clgvcan you post the complete stack trace?
11:19clgvyou can do (compile 'my.evil.namespace) on the repl and then use clojure.stacktrace/print-cause-trace
11:20ApeShotwhen the problem happens, I can't even do `lein repl`
11:20ApeShotI get the same error
11:20ApeShotCan I ask lein to start a repl without trying to load the main ns?
11:21clgvyeah you can just comment out the :main line
11:21ApeShotIn my project.clj
11:21ApeShot?
11:21clgvyes
11:21ApeShotCool
11:21ApeShotThanks.
11:22clgvremove the namespace from :aot vector as well, if it is listed there
11:22technomancylein update-in : assoc :main clojure.core -- repl
11:22ApeShotIncidentally, I have had some success building play-clj projects for android
11:22clgvtechnomancy: awesome. "update-in" is new to me
11:22technomancyclgv: it's a fun one
11:22ApeShotBut I keep reading that the dalvik GC isn't really up to game-like functionality for clojure's memory profile
11:23technomancyerr... dissoc :main, of course
11:23clgvtechnomancy: what was the procedure to get full stacktraces from leiningen when for example "lein repl" fails? some environment variable?
11:23ApeShotWhat is the newest intuition about this?
11:23technomancyclgv: proably something in :repl-options
11:25clgvtechnomancy: humm there is only :caught in the sample - that sounds as if it is operating in a running repl. I meant when the repl startup fails with an exception
11:29clgvApeShot: can you report what "DEBUG=true lein repl" or same with "lein run" outputs?
11:37SagiCZ1i get this when running lein test: Could not locate project_name/core_test__init.class or project_name/core_test.clj
11:39clgvSagiCZ1: so you have a require/use somewhere that wants to load project-name/core.test
11:39clgverr: project-name/core-test
11:39andyf_SagiCZ1: Not sure, but perhaps that is a sign of a mismatch between file names and namespaces defined in them? If you are willing to try out Eastwood, it checks for that quite quickly. https://github.com/jonase/eastwood#installation--quick-usage
11:40connerWhat would be the most idiomatic way to turn ["x: FOO" 1 2 3 "x: BAR" 4 5 6] into { "FOO" [1 2 3] "BAR" [4 5 6] }?
11:41bbloomlein removed support for jars in lib/ really?
11:41bbloomthat's annoying as hell.
11:43cbryannow i remember why i don't use xchat
11:43cbryansorry for the leavejoin spam
11:43ipostelnikconner (->> (partition-by #(.startsWith % "x: ")) (map (juxt first rest)) (into {}))
11:44SagiCZ1andyf_: You got it right, i was renaming my project and forgot to renaim dependencies in the test ns
11:44SagiCZ1(inc andyf_)
11:44lazybot⇒ 4
11:46cbryanthanks ipostelnik! im reading the docs on ->>, it seems like it 'just' prevents a sort of nested-hell?
11:46nextstephello, what's the clojure way for expressing the following pattern. I have some function for mapping stuff in a collection. Some operation inside that function (calling an external program or a service) is very inefficient if i call it just item by item. How can i cleanly group these while still preserving the 1-by-1 mapping???
11:46lazybotnextstep: Yes, 100% for sure.
11:48CookedGryphonyou could do partition on the output and doseq over the resulting batches
11:49dbascheither pmap or futures
11:49andyf_nextstep: If the collection you are mapping over can be treated as a generic sequence, you could use partition, and then concat afterwards if you want to put the groups back together.
11:49cbryani just started clojure 3 days ago, and every time i find out about something like `partition-by` I get goosebumps. joy of clojure, indeed
11:49SagiCZ1~pmap
11:49clojurebotpmap is not what you want
11:49clgvtrue
11:53nextstepyeah i think pmap is not a good solution, and i cannot see how partition would not entangle things either. i want to preserve my simple mapping function
11:53nextstepperhaps futures?
11:54nextstepas dbasch mentioned?
11:54arohnernextstep: I'd use partition & concat
11:55arohneralso, core.async much better for parallel processing rather than futures
11:55andyf_futures by themselves won?t group multiple items together.
11:55clgvnextstep: can you b more specific. do you just want to group according to a criterion or do you want to parallelize expensive computation?
11:57nextstepclgv: i have a very big stream, and i apply a simple map to each element
11:57nextstepinside the mapping function
11:57nextstepi call an external program
11:57nextstepbut i want to call this program with batches of items, not just an item at a time
11:57clgvwell then you have to explicitely partition the items and map over those partitions
11:58clgvprovided the external program supports batches
11:59clgve.g. (defn map-batched [size f coll] (apply concat (map f (partition-all size coll))))
11:59puredangeryou map find the core.async pipeline function to be useful
12:00nextstepclgv: yes, the external program supports batches
12:00clgvnextstep: you can do something as shown above where `f` gets a list of elements, calls your program and returns a list of results
12:01nextstepbut i want to avoid that my f function deals with multiple elements
12:01nextstepso i was thinking of using async
12:01nextstepand inside the f function sending items that get grouped
12:01nextstepand then forwarded to the external program
12:01nextstepi have many f functions, some have to deal with batches, some dont
12:02nextstepso it gets very messy
12:02clgvI am not sure about the side constraints of your scenario
12:04clgvyou should make explicit descriptions what the interface to that program is conceptually and what exactly your "different functions" are (clojure functions? calls to the program with different parameters? ...)
12:06nextstepclgv: the functions just take one parameter, the element of the collection to map
12:06nextstepthe external functions take many of these
12:07clgvwhat are "external functions"?
12:07nextstepunix programs that take thousands of items in one go
12:07nextstepor REST services
12:08clgvok.
12:08andyf_I?m pretty sure I?ve heard comments about core.async such as ?and it didn?t require changes to Clojure at all. Clojure is such that it could be implemented just as a library.? That is certainly true, but does it seem slightly disingenuous, in that part of that library is a reimplementation of most of the Clojure compiler (i.e. tools.analyzer{,.jvm,.js}) ?
12:08andyf_ugh. stupid smart quotes
12:08nextstepclgv: therefore grouping items makes it much faster
12:08dannersso i am reading through http://www.braveclojure.com/ and now i am on the vampire example. i get following error in the replArityException Wrong number of args (1) passed to: core/map clojure.lang.AFn.throwArity (AFn.java:429) . how do i know where my mistake in my clojure program is from this?
12:08nextstepbut i want to hide that from the main program
12:09nextstepthis is probably some kind of Go pattern, forward stuff to a proxy that groups calls and gets back with results
12:09clgvnextstep: ok. so where is the problem to just write one function that deals with batching, sending to external program and concatenating the results again. this function would completely hide the abtching except for a batch size parameter
12:09nextstepbut havent figured out
12:09nextstepyes
12:10nextstepbut i havent been able to figure out a clean solution
12:10cbryandanners: check the stack trace
12:10SagiCZ1danners: hi, this means that the map didnt get the correct number of args
12:10clgvwell I gave you a sketch of it above. you just have to specify what the variable part is that changes
12:11SagiCZ1cbryan: i have never found my mistake using stacktrace in clojure
12:11cbryanshould be like "AFN.throw...AFN.invoke...yournamespace.yourtcode (blah.clj:2025)"
12:11dannerscbryan: ah thanks
12:11clgvnextstep: can't you come up with examples how the map+batch should be invoked?
12:11dannersthats why it also shows the stacktrace...
12:11cbryanSagiCZ1: yeah, but he asked how to know where the error was :)
12:12nextstepclgv: (defn map-batched [size f coll] (apply concat (map f
12:12nextstep (partition-all size coll))))
12:12nextstepyou mean this sketch?
12:12justin_smithApeShot: just reading some scrollback, FYI it's normal to include a larger variety of things in one clj namespace than in eg. a java class file. And a project need not have any core.clj file, not to mention having more than one. Lein templates use that name because they need something generic, but a more descriptive name for a namespace is always better.
12:13clgvyeah. it shows a basic principle - I couldnt be more specific since I have no idea what a variable `f` would look like in your case.
12:13noncomi need to support clojure syntax and formatting in emacs, but without support for anything else clojure - what is my best option ?
12:14clgvso in that example it is a function that executes on batches, could also be change to (defn map-batched [size call-external coll] (apply concat (map (fn [coll] (call-external (prepare-params coll))) (partition-all size coll))))
12:15nextstepclgv: ok let me figure this out, only started using clojure a few days ago, so im a bit slow :)
12:17clgvnextstep: ok, just identify the changing params to such a function as sketched above
12:19nextstepclgv: i dont think i get your proposed solution. I want to call the external program from inside the mapping function like (map (fn [i] ... (call-external j)) coll)
12:20nextstepmy mapping function makes some changes to the item i of the collection coll
12:20nextstepon a case per case basis
12:21nextstepso i think its the only way to go, and hide from the function the fact that calling this program on a case per case basis is expensive
12:21clgvnextstep: well, separate the manipulation of the elements from the sending to the program
12:22clgvnextstep: you can easily do (map call-external (map preprocess-element coll))
12:22clgvnextstep: then it is easy to sneak in the batching
12:23clgve.g. (map-batched 100 call-external (map preprocess-element coll))
12:24CookedGryphonIs there a way to get a channel which closes at the same time as a mult, but doesn't get any of the values out of it
12:24CookedGryphonwithout tapping and just filtering everything
12:26clgvnextstep: the same applies to postprocessing btw
12:27nextstepclgv: aha, ok
12:28nextstepclgv: thanks for your patient explanations :)
12:28clgvyou are welcome
12:30EvanRcan i get a map pretty print that is actually readable?
12:31EvanRalternating lines of keyname value on the same column is not
12:32justin_smithEvanR: beyond a certain size clojure.pprint does the right thing
12:32EvanRi disagree
12:33justin_smithoh, I misread what you were saying
12:33llasramEvanR: you can try https://github.com/brandonbloom/fipp
12:33SagiCZ1,(clojure.pprint/pprint {:a 0 :b 2})
12:33clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.pprint>
12:33justin_smithso what behavior do you actually want?
12:33EvanRi cant see where entries begin or end
12:33borkdudeI miss a decent pretty printer that is usable from clojure and clojurescript
12:34EvanRive take this for granted so much i can only think of php's print_r as an example of showing a map
12:34clgvllasram: fipp is not much better than pprint
12:34EvanRwhich i know sounds ridiculous
12:35justin_smithEvanR: is that so much different? you get keys in one column, vals in another
12:35llasramclgv: Except that it's much easier to modify how it prints
12:35bbloomclgv: what's the problem?
12:35EvanRpprint is optimizing for having very little screen width, which makes sense in intellij
12:35EvanRjustin_smith: i dont get keys in one column values in another
12:35justin_smithEvanR: the width is configurable
12:35bbloomboth clojure.pprint and fipp offer configurable widths
12:35EvanRoh really
12:36bbloomdo you want pretty printing for debugging?
12:36bbloomtree whidbey
12:36bbloomtry* whidbey rather
12:36EvanRyes, and ok. checking on this width thing
12:36bbloomhttps://github.com/greglook/whidbey
12:36EvanR"miser-width"
12:37borkdudebbloom does that also work with a browser repl?
12:37bbloomborkdude: no
12:37clgvllasram: yeah some options are better to use
12:37SagiCZ1once i change ns from 'user' i cant access pprint anymore via 'pprint' .. someone suggested 'injections' in leiningen but it doesnt work for me.. what can i do to be able to always use pprint whenever i want?
12:37bbloomEvanR: i'm bias, as i wrote fipp and whidbey is built on fipp, but if you're looking for a good pretty printer for interactive debugging, whidbey is the way to go
12:38bbloomEvanR: it's faster and the output is less ambiguous (ie supports records and things) compared to pprint
12:38clgvllasram: bbloom: but I didnt gain much with fipp in comparison to pprint for nested data structure
12:38EvanRhow do i configure this global variable, *print-miser-width*
12:38bbloomclgv: but you lose the multi-second delay that sometimes happens when printing large structures with clojure.pprint
12:40clgvbbloom: I didn't want to criticize your lib in general. I just wanted to provide the information that I experienced the same with respect to how hash-maps are printed
12:40bbloomclgv: i'm not insulted, don't worry :-P i'd like to improve it, if you can explain what's wrong
12:41EvanRset! set def
12:41clgvbbloom: well that would probably lead to a general lib to format clojure code ;)
12:41SagiCZ1so how can i keep pprint loaded in repl no matter in what ns i am?
12:41bbloomclgv: fipp has recently added a code pretty printer
12:41Shayanjmare there any well-supported distributed programming packages for clojure?
12:41justin_smith,(require 'clojure.pprint)
12:41clojurebotnil
12:41bbloomclgv: but it makes no effort to beautify code. that's a non-goal
12:41Shayanjmor is it mostly "just use hadoop"?
12:42clgvbbloom: ah nice.
12:42justin_smith,(binding [clojure.pprint/*print-miser-width* 200 clojure.pprint/*print-right-margin* 500](clojure.pprint/pprint {:a 0 :b 1 :c 2 :d 3 :e 4 :f 5 :g 6 :h 7 :i 8 :j 9 :k 10 :l 11}))
12:42clojurebot{:e 4, :l 11, :k 10, :g 6, :c 2, ...}\n
12:42noonianSagiCZ1: you can also construct your own user namespace and require what you like there
12:42cbryanShayanjm: Storm
12:42justin_smith,(clojure.pprint/pprint {:a 0 :b 1 :c 2 :d 3 :e 4 :f 5 :g 6 :h 7 :i 8 :j 9 :k 10 :l 11})
12:42clojurebot{:e 4, :l 11, :k 10, :g 6, :c 2, ...}\n
12:42Shayanjmcbryan: much appreciated, will look into it
12:42Shayanjmwill be building a big crawler/scraper project
12:42bbloomclgv: fipp provides generic pretty printing infrastructure for *fast* pretty printers. where pretty printing is defined as an indenter that respects the right margin
12:42Shayanjmwill likely need a LOT of parallelization
12:42SagiCZ1justin_smith: so whenever i change ns i have to call the require function? sure there must be a better way..
12:42bbloomfull on code beautification is a much harder problem and one for which a generic infrastructure can't make good performance promises
12:42mdrogalisShayanjm: If you can afford a little more risk with a newer project, I released Onyx about a month ago.
12:43justin_smithEvanR: without the truncation clojurebot does, one of those would have had newlines, the other not
12:43cbryanShayanjm: https://storm.apache.org/
12:43Shayanjmmdrogalis: could probably afford risk. I'll look into both. What does onyx provide over storm?
12:43SagiCZ1bbloom: yeah, you need fuzzy logic and genetic algorithms!
12:43bbloomSagiCZ1: not really, but you do need context sensitivity
12:43justin_smithSagiCZ1: not change ns? I wasn't showing that to demonstrate how you should handle things though, I was trying to demonstrate the pprint control parameters
12:43technomancySagiCZ1: there is no good in-clojure solution for keeping stuff like pprint available everywhere. IMO that needs to be handled by your repl tools.
12:43mdrogalisShayanjm: https://github.com/MichaelDrogalis/onyx/blob/0.3.x/doc/user-guide/what-does-it-offer.md
12:43bbloomwhich you can encode in to your transformation from your source data in to the "pretty document" format of fipp
12:44EvanRjustin_smith: i have to wrap every pprint in this binding?
12:44SagiCZ1justin_smith: oh sorry
12:44Shayanjminteresting mdrogalis
12:44justin_smithEvanR: or you could set those bindings at the top level with the help of lein
12:44Shayanjmare you actively maintaining the project?
12:44cbryanmdrogalis: very cool
12:44bbloombut choosing an optimal layout may involve speculatively trying various layouts, which fipp explicitly disallows b/c it can be slow
12:44SagiCZ1so when developing do you usually stay in user ns and load everything in there?
12:45mdrogalisThanks. Next release might be out tomorrow morning. One more bug I want to fix before I unleash a bunch more features.
12:45justin_smithSagiCZ1: I make experiments in the user ns, define the final version of my code in a file, then require that file
12:45justin_smithSagiCZ1: that's not the only way to do it of course
12:47EvanRjustin_smith: well, now its all on one line
12:48clgvSagiCZ1: I am a namespace nomad. always switching to the namespaces where I need to dev something - or in a namespace that is using the ns to change
12:49justin_smithEvanR: I still have no idea what behavior you are actually looking for, you named a php function I googled it, and it had things in two columns in the example I saw
12:49EvanRi have yet to get pprint to do that
12:49EvanReven that
12:50technomancySagiCZ1: I typically use cider commands instead of calling tooling like that in the repl
12:50technomancySagiCZ1: nrepl-discover makes it super easy to expose arbitrary functions like pprint or trace from cider
12:50EvanRi can coerce it to do one of two things. one is {k v k v k v k v} the other is
12:50EvanRk
12:50technomancyshould be easy to do from vim or ccw or whatever too
12:50EvanRv
12:50EvanRk
12:50EvanRv
12:50justin_smithEvanR: do you have long v values?
12:51EvanRno they are all nested other things
12:51EvanRi have a string at the bottom somewhere which is "SecondAndFurtherGivenNamesOrInitialsThereof"
12:52EvanRif it just always did
12:52EvanRk v
12:52EvanRk v
12:52EvanRregardless of content then i would be ok
12:54EvanRheres an example http://codepad.org/1zndckFV
12:54EvanRof what pprint never does
12:54EvanRfor me
12:57bbloomEvanR: that code is not pretty printed with respect to a right column, it's simply indented
12:58SagiCZ1justin_smith, clgv, technomancy thanks for opinions, interesting to see that there is not just one "correct" way
12:58bbloomEvanR: if you set the width to 0 (or 1?), you can force maximum indenting
12:58EvanRill try that
12:59bbloomthe reason you don't typically see json style indenters for lisps is b/c they are practically useless
12:59bbloommost sequences are short enough that it doesn't make sense to spread them over multiple lines
13:00bbloomand since lists are so common, it would be hideous to see "(\t\nfoo\t\nbar\n)"
13:00EvanRi dont have a single list
13:00EvanRthis is a map
13:00bbloomsure, so if yuo really just want indenting for it, then set the width to 1
13:00EvanRi set the width to zero, and it did some stuff, seems like everything except put the k and value not on alternating lines with the same colum
13:01bbloomi can't speak for pprint with width = 1, but my library fipp will do what you expect
13:02bbloomwhidbey probably will do the right thing too, but I can't say for sure as it's only using my printing engine, not my specific printer
13:02EvanRthat is to say, width zero causes k and v to be on alternating lines
13:02bbloomEvanR: may i ask why you want this anyway?
13:02bbloomie why is the default behavior not good enough?
13:02EvanRi cant read my json-like data?
13:03EvanRk
13:03EvanRv
13:03EvanRk
13:03EvanRv
13:03EvanRi cannot read it
13:03EvanRanymore than if it was k v k v k v on one line
13:03EvanRin this case, it is the transpose, all on one column
13:03EvanRwith no separation
13:04bbloom*shrug* ok well, most people find it more readable for small collections to be horizontally laid out, so i don't really know if i can help you
13:04bbloomtry fipp with width set to 1
13:04bbloomit always keeps key/value pairs together on a single line no matter what
13:04tolstoyll
13:04tolstoyOops. ;)
13:04EvanRalso, the default behavior does indent, by one space. which is fine, but its just incomprehensible with the k v on alternating lines, which i guess its calling "miser style"
13:04EvanRbbloom: small collections?
13:05EvanRjust to be clear, its not horizontally laid out, its very vertical
13:06bbloomEvanR: i understand, but you don't: pprint (and fipp) attempt to make a non-stupid layout. they do not blindly indent everything
13:07bbloomthings will be laid out horizontally if they fit, or vertically if they don't
13:07bbloomhence width = 1 means nothing fits
13:07bbloomhowever, clojure.pprint will let keys and values be separate, fipp will not
13:07bbloomso try fipp with width = 1
13:07EvanRi can see where the reasoning came from for this
13:08katratxohi all, any hints on changing the logging level of a namespace at runtime? i'm using tools.logging
13:08bbloomtry (clojure.pprint/pprint [(repeat 3 :short) (repeat 10 :some-longer-keyword)]) and you'll understand
13:09EvanRi have a lot of horizontal space, but if i set the width to very wide, it will do k vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv k vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv which im trying to say is very in convenient
13:09justin_smithkatratxo: there is such thing as per namespace variable logging levels in tools.logging?
13:09bbloomEvanR: i'm done with this conversation until you tell me you've tried fipp with width = 1
13:09EvanRill say again, im talking about record-like maps, with field names and keys, its not some generic collection concept
13:09clgvjustin_smith: there is per java class
13:10EvanRfipp is installed, trying
13:10bbloom(fipp.edn/pprint {:foobar 123 :baz "asdfasdf"} {:width 1}) does exactly the thing you want
13:11katratxojustin_smith: not sure about that ... the documentation suggests that you can define the logging level of a namespace (at least with log4j)
13:12clgvkatratxo: yeah I have seen it per java class
13:13justin_smithkatratxo: oh, I did not see anything like that in the api overview doc page. But timbre explicitly supports per-namespace control
13:13clgvkatratxo: you can modify system properties for logging
13:14samfloresis there some roadmap for core.async leaving alpha?
13:15clgvsamflores: sssshhh! you are openening pandora's box :P
13:15samflores👀
13:15EvanRim getting no namespace fipp.edn
13:16EvanRand no namespace fipp.clojure
13:16katratxojustin_smith: do you know if timbre can capture the System.out and redirect it to a log? similar to log/with-logs ?
13:16bbloomEvanR: i'm happy to offer you support for fipp, but i'll leave general "how do i use clojure" support to the rest of the channel
13:16EvanRyeah
13:16justin_smithkatratxo: not sure, doesn't it use tools.logging?
13:16clgvsamflores: last time this discussion happened, I had the impression that the maintainers think that human rememberable versions have no use
13:17katratxojustin_smith: will check it out ... thanks
13:22EvanRfrustrated now
13:23EvanRi have [fipp "0.5.1"] in my project.clj, lein deps does nothing
13:23EvanR(require '[fipp.edn]) in lein repl gives CompilerException java.lang.RuntimeException: Unable to resolve symbol: record? in this context, compiling:(fipp/edn.clj:42:11)
13:23samfloresclgv, I guess I'll wait quietly then
13:24llasramEvanR: That function was added in Clojure 1.6
13:25llasramEvanR: Using an older version?
13:25EvanRClojure 1.5.1
13:25llasramWell there you go
13:26EvanRwhat am i doing with an old version
13:26llasramA question humans throughout history have asked themselves
13:27EvanRthis is ubuntu 14.04
13:27llasrameh?
13:27llasramEvanR: Clojure version is per-project, a feature of what you have in your Leiningen project.clj
13:27EvanRoh k
13:28bbloomif you installed leinigen with apt, you should uninstall it and use the preferred install method
13:28bbloomhttp://leiningen.org/
13:28EvanR[org.clojure/clojure "1.5.1"] is in my project file so that explains that, also i installed leiningen the way the site told me to
13:29llasramAwesome
13:29EvanRso ubuntu fortunately has nothing to do with it
13:29technomancybabilen: hate to be a broken record, but what's the odds of lein2 getting into debian jessie?
13:29EvanRso fipp depends on a particular version of clojure
13:30bbloomEvanR: a minimum version of clojure, yes
13:30EvanRshouldnt lein deps tell me?
13:30EvanRgood time to go to lunch
13:31technomancyEvanR: there's no way to distinguish between "minimum version" and "recommended version" in pom-speak
13:31EvanRpom pom ...
13:31EvanRProject Object Model
13:33technomancyEvanR: however, lein deps :tree will warn you about this
13:33technomancy[org.clojure/clojure "1.5.1"] overrides [fipp "0.5.1"] -> [org.clojure/clojure "1.6.0"]
13:44csd_where's the best place to host a small clojure web app for free?
13:44r4viheroku
13:45csd_r4vi: only downside there is they use postgres and i made this with mysql :-/
13:45technomancythere are mysql addons too; we just don't run them ourselves
13:45technomancybut, maybe that's a good excuse to stop using mysql =)
13:46csd_technomancy: you work for heroku?
13:46technomancyyeah
13:46csd_cool
13:47technomancylemme know if you have any questions
13:47csd_technomancy: do you think the server will complain if my app does some minor web scraping?
13:47technomancycsd_: shouldn't be a problem
13:47technomancyI mean, please respect the terms of service of the site being scraped, but that has nothing to do with us =)
13:52xeqiEvanR: `lein deps :tree` should produce some warnings about version mismatches, though that was broken for a couple of point releases in 2.4.*
14:32justin_smith,(deref (doto (promise) (deliver :ping)))
14:32clojurebot:ping
14:49borkdude,(chan)
14:49clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: chan in this context, compiling:(NO_SOURCE_PATH:0:0)>
14:50justin_smithborkdude: I don't think clojurebot will do anything with threads
14:51justin_smithborkdude: blame the bot quine
14:51borkdudejustin_smith you don't need threads per se for core.async right
14:51justin_smithborkdude: I guess we could port clj core.async to clojurebot?
14:51borkdudejustin_smith clojurescript
14:52justin_smithborkdude: sure, but clojurebot is not clojurescript
14:52justin_smithpoint being we would need a clj version of core.async that did not use threads
14:52borkdudejustin_smith k, well, one liners don't work well with core.async anyway probably
14:53justin_smithborkdude: yeah. I would make it easier to show people with questions how core.async stuff works though
14:53justin_smiths/I/It
14:56justin_smithborkdude: actually, a cljsbot would be good too
14:56borkdudejustin_smith yeah
14:57justin_smithI wonder if there is a way to do that that isn't totally insane
14:57borkdude{ (js/alert "haha"} }
14:57borkdudejustin_smith could look at clojurescript.net?
15:01justin_smithyeah, that would likely be a good start
15:02justin_smithborkdude: they link to this as their source https://github.com/kanaka/clojurescript
15:03justin_smithmix that with Raynes irc lib, and bob's your uncle
15:04perplexais there a better way to do (fn [a & option] (or option "default"))?
15:05justin_smith,((fn [a & option] (or option "default")) nil nil)
15:05clojurebot(nil)
15:06justin_smith,((fn [a & [option]] (or option "default")) nil nil)
15:06clojurebot"default"
15:06danielszmulewiczI would like to emit javascript to a string. Not via the cljs build process, but by using the compiler directly from source. Input is some clojure form (defn three+three [] (+ 3 3)), output should be: "node_test.core.three_PLUS_three = (function three_PLUS_three(){return ((3) + (3));" How do I achieve that?
15:07perplexaah, so & pushes the following params into a seq
15:07justin_smithperplexa: yeah, because it takes any number of params
15:08perplexayeah makes sense :)
15:23SagiCZ1would it benefit me to create a memoized version of count? i use count often and the linear time is really slow for me
15:24mgaareSagiCZ1: do you often find yourself counting the same thing multiple times?
15:25SagiCZ1mgaare: yeah
15:26SagiCZ1i guess thats a bad design though
15:26justin_smithSagiCZ1: you could use vectors or sets instead of lazy-seqs where applicable, they implement count in constant time
15:26SagiCZ1vectors count is constant?
15:26justin_smithyup
15:26SagiCZ1thats cool then, i use vectors mostly
15:26bbloomSagiCZ1: putting a memo table at the call site is likely to be a memory management nightmare -- justin_smith is right, prefer better data structures
15:26SagiCZ1thanks
15:27mmeixIf I want to partition a sequence of numbers, so that consecutive numbers are packed into separate vectors like so:
15:27mmeix[1 2 3 5 6 9 12 13] => '([1 2 3] [5 6] [9] [12 13])
15:27mmeixpartition-by doesn't help me much, because it only looks at one element at a time
15:27justin_smithmmeix: it can be done in a one-liner with reduce
15:29mmeixok, I guessed this to be a case for reduce
15:29mmeixbut didn't get it - will think further
15:29hyPiRionreduce, transduce
15:30mmeixok
15:30mmeixthanks
15:32justin_smith,(def input [1 2 3 5 6 9 12 13])
15:32clojurebot#'sandbox/input
15:32justin_smith,(reduce (fn [[acc contig] n] (if (= (inc (peek contig)) n) [acc (conj contig n)] [(conj acc contig) [n]])) [[] [(first input)]] (rest input))
15:32clojurebot[[[1 2 3] [5 6] [9]] [12 13]]
15:32justin_smithwait, that's a bit off isn't it :)
15:33justin_smith,(apply conj (reduce (fn [[acc contig] n] (if (= (inc (peek contig)) n) [acc (conj contig n)] [(conj acc contig) [n]])) [[] [(first input)]] (rest input)))
15:33clojurebot[[1 2 3] [5 6] [9] [12 13]]
15:33SagiCZ1beautiful
15:35justin_smithheh, thanks
15:37hyPiRionI feel this problem pops up quite often for some reason. And I always want to use (partition 2 1 ...) on it and it gets all messy
15:37hyPiRionit's for some reason not as straightforward to implement it
15:37mmeixah, missed that because of laptop sleep (after (def input...)
15:37justin_smithhyPiRion: yeah, my goto for that is multi-accumulator reduce
15:37justin_smithmmeix: should I repaste the code?
15:38justin_smithhyPiRion: I wonder if a multi-accumulator version of reduce without destructuring would be worth it?
15:38mmeixtried partition 2 1, got lots of parens ...
15:39hyPiRionjustin_smith: multi-accumulator?
15:39mmeixjustin_smith if you would be so kind ...
15:39justin_smith,(apply conj (reduce (fn [[acc contig] n] (if (= (inc (peek contig)) n) [acc (conj contig n)] [(conj acc contig) [n]])) [[] [(first input)]] (rest input)))
15:39clojurebot[[1 2 3] [5 6] [9] [12 13]]
15:39justin_smithhyPiRion: I have two accumulator values, thanks to destructuring
15:40justin_smithhyPiRion: but I guess that doesn't make sense beause apply would have to be used internally anyway since you would need to return a collection...
15:40justin_smithhyPiRion: or just use recur, of course
15:40mmeixwow, that's a fat oneliner :-) will study it thoroughly
15:40justin_smithmmeix: doesn't qualify as a one-liner, I don't think
15:41justin_smithmmeix: it's not so bad when on a few lines and indented properly
15:41mmeixjust doin that
15:42justin_smithmmeix: so as I was saying, the main trick is using destructuring / returning a vector in order to have more than one accumulator
15:42mmeixah, that's a new technique for a beginner
15:43mmeixah: that was the point I couldn't get: "multiple accumulators"
15:43mmeixthanks a lot
15:44mmeix(inc justin_smith)
15:44lazybot⇒ 108
15:44hyPiRionIt's not very common I think
15:45justin_smithhyPiRion: I do it often, maybe it's because I am weird
15:45mmeixthis is something I expect to need a lot: segemnting vectors of musical notes by some criterion
15:45mmeixthanks for input!
15:46hyPiRionmmeix: oh, just a warning: That one won't work on infinite lists
15:46mmeixunderstand ...
15:47mmeixI don't expect my musical phrases to be of infinite length though :-)
15:47justin_smithmmeix: I bet you could do some fun stuff with derive and multimethods to describe musical rules
15:47mmeixderive? (looking up)
15:48mmeixok, have to leave
15:48mmeixthanks again
15:48justin_smithnp
15:50justin_smithhyPiRion: I guess a lazy version could be done with (partition 2 1 ...) and take-while
15:50justin_smithand lazy-seq of course
15:58arohnerrunning new Cider (installed from melpa today), I don't get stacktraces when an error occurs. The error window pops up, but it's empty
15:58arohnerany ideas?
15:59arohnerFWIW, my previous version didn't have working stacktraces either, which is why I tried to upgrade
15:59arohnerI got the error about missing the cider-nrepl .jar, but I fixed that
15:59justin_smitharohner: I assume you can at least use (pst)
15:59arohneryeah
15:59technomancyhave you tried the stable version?
16:00arohnertechnomancy: which one is that? from melpa-stable?
16:00justin_smitharohner: 0.7.0
16:01justin_smitharohner: also, the clojure-emacs channel has at least one cider dev who doesn't follow this channel on it
16:01technomancyarohner: 0.7.0 and 0.6.0 are both a lot more likely to work than whatever melpa gives you
16:01technomancymelpa-stable will probably give you 0.7.0 claiming to be some nonsense datestamped version
16:02arohnerjustin_smith: technomancy: thanks
16:02arohnertechnomancy: how do you recommend I install it?
16:02technomancyarohner: I ... =(
16:02technomancyI don't have a recommendation.
16:02arohnergit clone and stick in ~/.emacs.d/?
16:02technomancyif you use emacs 24.3, you can install from marmalade
16:02technomancybut emacs 24.4 has a bug that breaks transitive deps over HTTPS
16:03technomancyobviously don't install over non-TLS (melpa, melpa-stable)
16:03technomancyso yeah, manual clone is nice because you're in control, but the deps are tedious to track down
16:03arohnerI think marmalade gave me 0.6.0, which also didn't work
16:03arohnerbut sounds like that's more likely to get working
16:04technomancyel-get works, but I can't recommend it out of the box, it's only safe to use if you (setq el-get-allow-insecure nil)
16:04technomancyI'm using 0.6.0
16:04dysfuni think life would be particularly miserable without melpa
16:04dbaschI had problems with 0.7.0, sticking to 0.6.0 because it works fine for me
16:04technomancyall the package.el sources are fatally flawed at the moment
16:05technomancyunless you use marmalade and hold off on the emacs 24.4 upgrade
16:05dysfunyeah, but it's still pretty new tech
16:05technomancydysfun: that's not a good excuse
16:05technomancyeven if it were true, which it's not
16:06dysfunfrankly, pre-melpa, i didn't bother at all
16:06dysfunbecause there just wasn't enough stuff available
16:06csd_technomancy: question about heroku
16:06technomancydysfun: now you're installing software in a way that's trivial to MITM. is this an improvement?
16:06arohnerok, so I'm back on cider 0.6.0, and stacktraces don't pop up in a buffer
16:06technomancycsd_: sure, go ahead
16:06arohnerI just get the first line of the stacktrace in the repl
16:07csd_i'm trying to deploy and i'm running into a boot timeout error. my app is getting killed while its compiling basically. would this recompile happen every time the dyno restarts?
16:07dysfuntechnomancy: i *have* installed software in a way that is trivial to MITM. And probably won't be MITMed. and i try not to live my life in a tinfoil hat manner
16:07justin_smitharohner: I think there is a config variable for that
16:07technomancydysfun: well, luckily I don't use any software you've released in a production setting where user data is at stake
16:08arohnerjustin_smith: I have (setq cider-show-error-buffer t)
16:08technomancycsd_: that's common if you're not creating an uberjar at git push time. the uberjar approach is strongly recommended for this reason.
16:08dysfuntechnomancy: everything you use is already backdoored and you're worried about a highly improbable event instead?
16:09technomancydysfun: the level of sophistication to pull off an HTTP MITM is laughably low
16:09csd_do people that take that tack include the .jar in their git repo?
16:09dysfunhow many times do you think i'm going to have to install a package from elpa?
16:09csd_or is there another way to upload it
16:09dysfunmelpa*
16:09clojurebotA nod, you know, is as good as a wink to a blind horse.
16:09llasramclojurebot: or?
16:09clojurebotor is there another way to upload it
16:09technomancycsd_: no, you push the git repo to the build servers and the uberjar is created there
16:10technomancydysfun: this is basic computing hygiene
16:10technomancy"don't put that in your mouth, you don't know where it's been" of ones and zeroes
16:10dysfuni suppose you have a strip of tape over your webcam just in case the NSA is watching too
16:11technomancyit's one thing to guard against a nation state adversary, it's another to guard against attacks that are trivial to preform
16:11dysfuni'm not arguing the services shouldn't be better, but there are much bigger things for me to worry about
16:11csd_technomancy: guessing i just need to specify :uberjar-name in project.clj and that should take care of things?
16:11technomancycsd_: yeah
16:11dysfuni install elisp from melpa once in a blue moon. i'm not going to get paranoid about that
16:11csd_cool thanks
16:11technomancycsd_: and change your procfile to use the uberjar instead of lein run or whatever
16:12justin_smithdysfun: he's someone who works on the dependency resolution and deployment stack, I'd say he's doing us a favor by letting us know when something is sketchy, and we can decide how to act on that info
16:12csd_is there a way to do lein ring server-headless via uberjar
16:13technomancymy laptop has credentials that would allow me to steal data from customers that include bitcoin exchanges.
16:13dysfunyou mean you want your main class to start a server?
16:13dysfunah. well i certainly wouldn't keep credentials like that on here
16:14technomancyif I use a dysfun-produced jar in one of my projects, I've created a large incentive for someone to attack melpa.
16:14dysfunon the other hand, since all of my modules are on github, you can read the source
16:14technomancythere would be very little technically challenging about pulling off this attack
16:15technomancydysfun: I'm not going to build from source, I'm going to get it from clojars.
16:16technomancyeven if I built from github, you probably haven't disable force-push on your repos
16:16dysfunsee, that sounds like a terrible idea now, because you never know that all of those people releasing to clojars are quite as careful as you
16:17dysfunbut my point about it being on github was merely that if you don't trust the code, you can read it and determine if it's a risk
16:17technomancyit is pretty terrible, but at least clojars can't be trivially MITM'd any more.
16:17technomancythere are really easy things you can do to prevent simple attacks.
16:17technomancythere are really difficult things you can maybe do to hopefully prevent sophisticated attacks.
16:18dbaschdysfun: sneaking malicious obfuscated code in open source is trivial and it’s been done
16:18technomancyjust because some of it is hard doesn't mean the easy stuff isn't worth bothering with.
16:18TimMcdysfun: I do in fact keep a sticky note over my webcam. It's easy and makes sense.
16:18dysfundbasch: thousands of times. thousands of times in linux alone i'd wager
16:19TimMcIt's not weird to guard against attacks that have already happened to other people.
16:19dbaschnot like anybody ever looks at the source code of even a fraction of what they run blindly
16:19technomancyI don't have a webcam, FWIW.
16:19justin_smithTimMc: dysfun: I leave mine uncovered, the sight any attacker would witness if they turned it on would be its own punishment
16:19dysfuntechnomancy: no. but on the other hand, the fact that i'm going to install each package precisely once does somewhat limit the vector of attack
16:19technomancybut the fact that they aren't hard-wired into the activity LED pisses me off
16:19dysfunthey are on some laptops
16:20TimMctechnomancy: Even that doesn't help -- you can turn it on, take a picture, and turn it off again without the user noticing.
16:20dbaschlistening in on someone is much more useful than looking at them with a camera anyway
16:20dysfunexactly
16:20dbaschtracking your keystrokes even more so
16:20TimMcMicrophones are even worse, of course. No activity light.
16:20justin_smithmy favorite recent conspiracy theory: FBI complains loudly about google / apple not giving them back doors into their mobile systems as a cover for the fact that they already have access
16:20dysfunand of course there was that malware that used microphones and speakers as a back channel too
16:21TimMcAnyway, point is, it's silly to not take precautions where there's low cost and high gain.
16:21TimMcAnd layered security is a thing.
16:21dysfunand it would be lovely if it was there, don't get me wrong
16:22dysfuni would like to see SSL be used everywhere, all the time
16:26bodie_anyone tried cursive with clojurescript?
16:26bodie_IDEA fork built around lein I guess?
16:27bodie_I've been using lighttable but its cljs integration is a little wack
16:27justin_smithbodie_: it's an idea plugin by cfleming that uses lein
16:27mdrogalisGitHub changed Clojure code highlighting. Do not like D:
16:27SagiCZ1bodie_: i've been using cursive for weeks now
16:27SagiCZ1bodie_: but only clojure
16:27borkdudebodie_ yes, works with clojurescript
16:27bodie_hm
16:27bodie_interesting
16:28borkdudebodie_ in the sense of highlighting etc
16:28borkdudebodie_ I build from lein cljsbuild externally
16:30boblarrickhow do I flatten something like [ [1 2 3] :b 'a] into (1 2 3 :b 'a) ?
16:30bodie_borkdude, do you have a live browser setup you like? i.e. auto refresh, eval from the repl perhaps
16:30bodie_I've been really digging the decently tight integration lighttable has there
16:30borkdudebodie_ you can have a look at lein new liberagent, that's basically my setup
16:30borkdudebodie_ it's inspired by chestnut
16:31borkdudeI want to cover om + reagent in a 40 minute talk... I think I'm already short in time
16:32boblarrick(reduce conj …) i guess
16:32justin_smithboblarrick: apply conj would suffic
16:32mdrogalisreduce/conj is my favorite Clojure idiom, I think.
16:32mdrogalis,(reduce conj (list) (range 5))
16:33clojurebot(4 3 2 1 0)
16:33justin_smith,(apply conj [1 2 3] :b ;a)
16:33clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
16:33justin_smith,(apply conj [1 2 3] :b 'a)
16:33clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol>
16:33justin_smitherr
16:33bodie_borkdude, so cljsbuild auto + figwheel = live js updating, right?
16:33justin_smith,(apply conj [[1 2 3] :b 'a]) ; that's what I meant
16:33clojurebot[1 2 3 :b a]
16:34borkdudebodie_ true
16:34bodie_and then there must be some way to tie in the repl as well
16:34borkdudebodie_ if you read the docs on lein new liberagent it says it all
16:34bodie_okay, cool
16:34bodie_was just glancing over the list of deps
16:34borkdudebodie_ fighweel = lein cljsbuild auto + updating
16:34justin_smithmdrogalis: except for conj reduce doesn't do anything apply wouldn't be doing
16:34bodie_most of it is backend stuff I don't need right now
16:34SagiCZ1can i map backwards? like this (map #(% coll) [foo1 foo2 foo3 ..])
16:35borkdudebodie_ just comment them out and remove it
16:35justin_smithSagiCZ1: sure, that works, or you can use juxt
16:35bodie_yeah, figuring out what I *do* need :) hehe
16:35bodie_thanks for the pointer!
16:35mdrogalisjustin_smith: Eh? Oh, I guess I should've qualified that with "reverse" idiom. Not in general.
16:35justin_smith,(map #(% [1 2]) [+ * / -])
16:35clojurebot#<ClassCastException java.lang.ClassCastException: Cannot cast clojure.lang.PersistentVector to java.lang.Number>
16:35SagiCZ1justin_smith: ok
16:35justin_smith,(map #(apply % [1 2]) [+ * / -])
16:35clojurebot(3 2 1/2 -1)
16:35SagiCZ1it says unable to resolve symbol foo1 in this context.. so idk
16:36justin_smith,(apply (juxt + * / -) [1 2])
16:36clojurebot[3 2 1/2 -1]
16:36justin_smithSagiCZ1: well you need to define things before you can call them...
16:36rubber_duckcan someone point me to a minimal implementation of a transducing process so I can wrap my head arround the spec - it's kind of hard to figure out how to implement one without types :(
16:37justin_smith,(apply conj () (range 5)) ; mdrogalis
16:37clojurebot(4 3 2 1 0)
16:38SagiCZ1justin_smith: yeah my mistake.. and can i get name of the function from the IFn object? (name (defn foo [] ..))
16:38justin_smithSagiCZ1: it sounds like you are trying to do something weird here...
16:39SagiCZ1justin_smith: yeah.. just want to save some typing
16:39SagiCZ1let me explain
16:40SagiCZ1i want to have a map where keywords are made from function names, and values are results of calls to those functions like so {:foo1 (foo1 coll) :foo2 (foo2 coll) ..}
16:41rubber_duckSagiCZ1, IIRC fns don't have names vars do
16:42SagiCZ1rubber_duck: how would i turn the var name into keyword?
16:42rubber_duckbut I'm not 100% on that It's been a long time since I mucked around with that
16:42mdrogalisjustin_smith: Hah, cool :D
16:43stuartsierraYes, vars have names, you can get it from their metadata as :name and :ns, then ns-name, …
16:43rubber_duckSagiCZ1, from the sound of what you're trying to do I'd say you would use a macro
16:44SagiCZ1,(def foo)
16:44rubber_duck(mymacro (foo ...) (bar ...)) -> expand in to {:foo (foo ...) :bar (bar ...)}
16:44clojurebot#'sandbox/foo
16:44SagiCZ1,(meta foo)
16:44clojurebotnil
16:45SagiCZ1rubber_duck: sounds correct, but i am a macro virgin.. i bet i will do something wrong, forget some gensym or someting and my whole project literally explodes
16:45justin_smith,(into {} (for [f [#'+ #'- #'* #'/]] [(keyword (:name (meta f))) (f 1 2)])) ; SagiCZ1
16:45clojurebot{:+ 3, :- -1, :* 2, :/ 1/2}
16:45justin_smithrubber_duck: can be done without a macro ^
16:45SagiCZ1justin_smith: do i need those ugly hashmarks?
16:46justin_smith,(= #'+ (var +))
16:46clojurebottrue
16:46stuartsierraSagiCZ1: What's wrong with writing {:foo (foo …) :bar (bar …)} ?
16:46justin_smith,(into {} (for [f [(var +) (var -) (var *) (var /)]] [(keyword (:name (meta f))) (f 1 2)])) ; SagiCZ1
16:46clojurebot{:+ 3, :- -1, :* 2, :/ 1/2}
16:46justin_smithstuartsierra: excellent point
16:47SagiCZ1stuartsierra: i was just being lazy and curious
16:47SagiCZ1thank you for help
16:48stuartsierra;)
16:52boblarrickOK nevermind still stuck
16:52boblarrickhow to flatten something like '((168 99) 68 (407 53 335) 158 (168 99)) ?
16:53mearnsh,(flatten '((168 99) 68 (407 53 335) 158 (168 99)))
16:53clojurebot(168 99 68 407 53 ...)
16:53justin_smithboblarrick: how did it get that shape in the first place?
16:53boblarrickcombo/cartesian-product
16:55justin_smithwait, clojure.math.combinatorics/cartesian-product mixes sequences and elements in its output?
16:57dbaschboblarrick: if your single elements were one-element lists you could do apply concat, but really you shouldn’t have created that output
16:57justin_smithboblarrick: anyway, the right way to deal with something like that isn't flatten, it's using something that gives you the shape of data you need and using it apropriately, because flatten can do bad things if any of the elements you are working with are themselves collections
16:57boblarrick /shrug
17:00boblarrickI've got millions of these things, and i need the generation and the flattening to be quick
17:01boblarrickworried doing things "the right way" might add overhead, that would add up to a runtime I can't tolerate
17:01dbasch,(apply concat (map #(if (coll? %) % [%]) '((168 99) 68 (407 53 335) 158 (168 99))))
17:01justin_smithflatten is not quick, apply concat would be quicker if the data format were consistent
17:01clojurebot(168 99 68 407 53 ...)
17:02justin_smithboblarrick: inconsistent data formats cause all code that interacts with them to be more complex, it can be a rippling effect that increases complexity throughout a codebase. Better to deal with it directly where the data is generated
17:03boblarrickthis is where the data is generated
17:03boblarricksorry I have to run, I'll benchmark some things and see what's u
17:03boblarrickup
17:05dbaschboblarrick: can you paste a gist/refheap with the code that generates the data
17:05dbasch?
17:05justin_smithboblarrick: also, I have no idea how one gets combo/cartesian-product to output anything but sequences
17:07justin_smithdbasch: nice hack - better than flatten at least
17:08boblarrickhttps://www.refheap.com/92464
17:09boblarrickdbasch: (map flatten) works as part of comp'ed transducer, didn't have similar luck with (apply concat (map irc://card.freenode.net:6667/#(if (coll? %) % [%])
17:09boblarrickreally gotta run, thanks for help!
17:11justin_smithso cartesian-product did not output any individual items, but it was asked to intermingle two element lists (cows) with three elements lists (foos) and single items (bars)
17:11justin_smithredefing bars would be enough to make a concat based solution work
17:12justin_smith(def bars [[:b] [:c] [:d]]) - then one can do consistent data operations on the result
17:16dbaschflatten really should be deprecated
17:16dbaschit probably causes more problems than it solves
17:16amalloydbasch: (apply concat (map f xs)) is just (mapcat f xs)
17:16dbaschtrue
17:16justin_smithdbasch: it's a codependent partner to bad design
17:18dbaschmapcat is a very useful function, I usually remember it when I’m coding something from scratch
17:18dbaschI tend to think differently when I’m solving someone else’s problem for some reason
17:20dbaschI have yet to see a justifiable use of flatten though
17:21dbaschperhaps when parsing horrendous html?
17:23dav_nick dav
17:23justin_smithdbasch: it could argubly be useful when using results apis that insist on turning every single element list into a single item with no list
17:24justin_smithdbasch: but once again, it's just a sign of bad design somewhere else
17:25dbaschreminds me of the tagline for nokogiri, an html parser for ruby
17:25puredanger,(defn flatten' [s] (map (constantly '__) (flatten s)))
17:25clojurebot#'sandbox/flatten'
17:25puredanger,(flatten' ['tomato (range 5)])
17:25clojurebot(__ __ __ __ __ ...)
17:25dbasch“XML is like violence - if it doesn’t solve your problems, you are not using enough of it.”
17:25justin_smithlol
17:25puredangersee, I flattened it
17:26puredangerthat's my new tag line, btw
17:28danielszmulewicz(inc puredanger)
17:28lazybot⇒ 19
17:28danielszmulewiczthat's for making me laugh
17:28puredangerI shall treasure that inc
17:28puredanger,(flatten' 'danielszmulewicz)
17:28justin_smith,(defn flatten'' [s] (map #(symbol (apply str (map (constantly \_) (str %)))) (flatten s)))
17:28clojurebot#'sandbox/flatten''
17:28clojurebot()
17:28danielszmulewiczHey I disappeared instead...
17:29justin_smith,(flatten'' '(daniel ((szmulewicz))))
17:29clojurebot(______ __________)
17:29puredangerdanielszmulewicz: forgot to make it seqable
17:29puredangerjustin_smith: that should be called redact
17:29justin_smithgood point
17:30danielszmulewiczI feel better.
17:30danielszmulewicza bit flat
17:31justin_smith,(defn carbonate [s] (map #(symbol (apply str (map (constantly `\') (str %)))) (flatten s)))
17:31clojurebot#'sandbox/carbonate
17:31justin_smith,(carbonate '(daniel ((szmulewicz))))
17:31clojurebot('''''' '''''''''')
17:31danielszmulewiczthat's worth an inc too
17:31danielszmulewicz(inc justin_smith)
17:31lazybot⇒ 109
17:33danielszmulewiczDoes clojurescript has something like emit-string which compiles and hands over a string?
17:34danielszmulewiczHere's an example of what I'm after: (emit-string '(defn three+three [] (+ 3
17:34danielszmulewicz 3))
17:35danielszmulewiczOutput should be: "ns.core.three_PLUS_three =
17:35danielszmulewicz (function three_PLUS_three(){return ((3) + (3));
17:36danielszmulewiczBasically what emit does in cljs.compiler.
17:36danielszmulewiczwhere's dnolen?
17:37justin_smithdanielszmulewicz: touring europe with his band last I heard
17:37danielszmulewiczjustin_smith: oh, right!
17:38danielszmulewiczI saw the tweets. I had forgotten.
18:04csd_I'm looking for some blog posts on best practices for managing code across developing locally, production server, etc. E.g. the fact that you want to juggle having one code base, but having to support different configurations for database server or what have you... anyone know of anything?
18:05hiredmanthe old standards are environment variables and configuration files
18:05technomancyuse bcrypt
18:05technomancyoh wait, wrong meme
18:05hiredmanthere are libraries that deal with both, pick one and do that
18:05technomancycsd_: env variables are arguably simpler, but they can't handle nested values or really anything non-string.
18:06technomancyif you're on heroku, I recommend environ. otherwise carica.
18:06csd_so basically i should create on my local comp and on the remote comp a path variable like PRODUCTION? and then if it's true do one things, and otherwise the other?
18:06hiredmanhttps://twitter.com/hiredman_/status/527581910155800577 tweetsare basically blog posts, right?
18:06technomancycsd_: don't set PRODUCTION, set whatever it is you actually care about doing differently in production vs dev.
18:06joshuafcolecsd_ We use node at my dayjob, but it's the same concept. We define a NODE_ENV=<key>
18:06joshuafcolewhere <key> is the key in an enumeration of available configurations
18:07joshuafcoleincluding dev, stage, and prod
18:07technomancyI would recommend against bundling them up like that.
18:07mdeboardAnyone having issues with github atm
18:07hiredmanhttps://github.com/sonian/carica is generally what we use at sonian (surprise)
18:07hiredmanit uses configuration files over environment variables
18:07technomancyyour provisioning tool should handle grouping configs, and your application should just read single values it cares about.
18:07hiredmanand does some merging stuff
18:07csd_why not just have a true/false env for development vs not, and then a config file with the different types of options depending on how the env var is set
18:07mdeboardhiredman, You work at Sonian eh? Your blog post on transitioning from backbone to react was a great help.
18:08joshuafcoleYou can, but it's a lot less flexible
18:08csd_how so
18:08puredangersome people like the environ library to help with this stuff https://github.com/weavejester/environ
18:08joshuafcoleWhat if you want to introduce an integration server?
18:08joshuafcoleor a staging server?
18:08joshuafcolethat has some of the features of dev and some of prod?
18:08technomancycsd_: why would you put production config on your dev machines?
18:08hiredmancsd_: it depends on how many places you might deploy to
18:08csd_gotcha
18:09hiredmancsd_: for example at work we have dev, qa, ua, plus multiple production environments
18:09csd_so when you guys are working on a project you stick those vars into your bash_rc? or is there a tool that manages them
18:10joshuafcoleDepends on your deploy system. If it's flexible enough, you can have a single config that's provisioned by the deploy system
18:10technomancycsd_: for env vars I put the default value in the code and only set the env var to override it, but I don't feel great about it.
18:10joshuafcolea good middle ground is to have a set of control scripts for your applications in each environment that have the right env var baked in
18:10technomancyone big downside of env vars is you can't change them without restarting the JVM, which is super tedious.
18:10joshuafcolemhmm
18:13technomancyideally you'd only set them in actual deployments and not in development, because everyone gets super confused about how to reliably set env vars in dev in ways that will work outside bash.
18:13csd_puredanger: that library looks pretty useful
18:14technomancyenviron might fix the change-without-restart problem; I forget
18:16puredangerwell that's not an issue with java system properties
18:16puredangerand those are supported by environ, so there's probably options at least
18:19technomancynice
19:12EvanRis there a thing where you can put (example (my-fun a b c) d) which does a sanity check/doc. assert?
19:13{blake},(println ["Y" "N"])
19:13clojurebot[Y N]\n
19:13{blake}(map println ["Y" "N"])
19:13{blake},(map println ["Y" "N"])
19:13clojurebot(Y\nN\nnil nil)
19:13{blake}huh
19:14justin_smith{blake}: the output of println gets mixed with the return value of map
19:14{blake}justin_smith, Right.
19:14justin_smith,(dorun (map println ["Y" "N"]))
19:14clojurebotY\nN\n
19:14justin_smithI assume you would never need that list of nils
19:15{blake}justin_smith, No, it's the sort of thing that trips me up when I hit one thing I don't understand, then start inserting println to try to figure it out.
19:16justin_smithright :)
19:16justin_smithusing a proper logger helps
19:16{blake}What would qualify as a proper logger?
19:17justin_smith{blake}: another trick I like is (defonce debug (atom [])) followed by various calls to (swap! debug conj [:descriptor value])
19:17{blake}justin_smith, creates a running log of whatever you swap?
19:18justin_smith{blake}: right, and you can play with the data in the repl
19:18justin_smith{blake}: sometimes it helps because you can actually play with the values in the repl
19:18justin_smithbut that's not a proper logger
19:18justin_smithit's just a technique I like
19:18{blake}*nod*
19:18justin_smithfor a proper logger I would use tools.logging or timbre
19:19{blake}'k. I'll have to check those out.
19:19{blake}So, I =think= I have a vector of ["Y" "N"]. But when I try to map I just get a LazySeq.
19:20justin_smithmap returns lazyseqs...
19:20justin_smith,(class (map identity [1 2]))
19:20clojurebotclojure.lang.LazySeq
19:20justin_smith,(class (into (empty [1 1]) (map identity [1 2])))
19:20clojurebotclojure.lang.PersistentVector
19:21justin_smiththe problem with into / empty is it reverses the order of lists
19:21justin_smithbut it preserves the type!
19:21andreijustin_smith: on the debugging atom, then you repeatedly ask for debug atom value after you do something?
19:21utschey guys, what is the transducer equivalent of "map<" from core.async?
19:22justin_smithandrei: I deref the debug atom in the repl, and do things with the data until I understand my bug
19:22justin_smithandrei: I also sometimes copy the data in said atom over into unit tests
19:23andreijustin_smith: but this is really nice :) I like that you could also take just a couple of items and inspect them instead of browsing through screens of logs
19:24justin_smithandrei: yes, I find it a very productive way to figure out what my code is doing while developing
19:24{blake}I'm trying to take a list and produce HTML, like (map #("<option>"%"</option>") l) and instead I'm getting back "lazySeq".
19:24{blake}Which is the sort of thing I thought I was beyond at this point. :/
19:24justin_smithandrei: of course log still have their purpose (for example figuring out what is actually going on at runtime on the production server)
19:25arrdem{blake}: apply str? or just use hiccup :P
19:25justin_smith{blake}: apply str
19:25justin_smith(inc arrdem)
19:25lazybot⇒ 38
19:25agarmanquestion re: java generics interfaces in reify; do I just ignore the parameterized portion of the interface when implementing reify because java generics are erased anyhow?
19:25{blake}arrdem, Yeah. I don't usually mix up apply and map these days.
19:25justin_smithyeah, no downside to just using hiccup
19:25{blake}And, yeah, I'm going to use hiccup.
19:26justin_smithagarman: yeah, generics are an illusion :)
19:26arrdemhiccup is pure awesome
19:26justin_smithor more precisely - a java compiler concept, and we are not using the java compiler
19:26{blake}I was just throwing up some output.
19:26arrdemfor sure
19:26justin_smith{blake}: hope it's not ebola!
19:26{blake}Generics are part of the long war of statically typed languages against their type systems.
19:27{blake}justin_smith, badum-tish
19:28justin_smith,(str (map inc (range 5))) ; {blake}
19:28clojurebot"clojure.lang.LazySeq@1c3e4a2"
19:28justin_smith,(apply str (map inc (range 5))) ; {blake}
19:28clojurebot"12345"
19:32{blake}justin_smith, Yeah. My face is red. And not from the Halloween makeup.
19:34justin_smith(pr-str (map inc (range 5))) ; another option
19:34justin_smith,(pr-str (map inc (range 5))) ; another option
19:34clojurebot"(1 2 3 4 5)"
19:34justin_smithpr-str produces better output for debugging
19:35justin_smith,((juxt str pr-str) "a")
19:35clojurebot["a" "\"a\""]
19:35{blake}Fair point.
19:35{blake}Ima use hiccup.
19:35justin_smiththe pr-str differentiates a symbol from a string, str does not
19:36{blake}justin_smith, I've used it. Then forgot about it.
19:37justin_smith{blake}: reminds me of things I do :)
19:38{blake}justin_smith, It's been an amazing year spent with Clojure. I forgotten more than I've learned. Wait.
19:47amalloyoh boo, i just realized i actually do use C-z for things other than suspending. might need to find a new tmux prefix key
19:48amalloyC-c C-z to go to emacs's repl is just too hardwired into my fingers for me to train out of
19:49justin_smithemacs' repl as in ielm?
19:49nwolfeI like ` as my tmux prefix key
19:49justin_smithI thought I was the only one who ever used that
19:50amalloyjustin_smith: no, slime, of course
19:50justin_smithheh
19:50amalloynwolfe: that sounds horrific. don't you ever type a `?
19:51nwolfeamalloy: Haha it's not horrific - the few times I do need to actually enter a ` character I just press it twice
19:54tuftcrazy to tire mentally because i'm back to little muscle memory
19:54nwolfeamalloy: I believe all I had to set were these 3 lines: https://github.com/nwolfe/dotfiles/blob/master/lib/tmux.conf.symlink#L78-L82
19:55amalloytuft: i forget, does it need two hands, or is there a one-handed way to do it?
20:06justin_smithwow, fascinating
20:06justin_smiththe personal version duplicates qwerty
20:06justin_smithhttp://www.shareware-beach.com/2007/08/datahand-review/
20:08danielszmulewiczThis is a proof of concept to show how ClojureScript can be used in the context of Apple's JavaScript for Automation. https://gist.github.com/danielsz/9c4ed2fbf4c0ac6b2d95
20:08EvanRis there a function to consume a seq and give the first non-nil value
20:08justin_smithEvanR: (first (filter (complement nil?) s))
20:09justin_smith,(some identity [nil false 3])
20:09dbaschor (first (remove nil? s))
20:09clojurebot3
20:09justin_smith,(keep idenity [nil false 3])
20:09clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: idenity in this context, compiling:(NO_SOURCE_PATH:0:0)>
20:10justin_smith,(keep identity [nil false 3])
20:10clojurebot(false 3)
20:10justin_smithdbasch: yeah, that one is better :)
20:13EvanRi saw this identity function, is it the identity function?
20:13EvanRi guess the keep is relying on natural truthiness
20:13justin_smithEvanR: keep is like map, but it discards nils
20:14EvanRok id still need first
20:14justin_smithyeah
20:14justin_smithif you don't want false, (some identity s) works
20:14justin_smithor you can just do (first (remove nil? s))
20:15EvanRi need to distinguish between nil and false here
20:15EvanRso keep should work
20:16EvanRand im going the hell home
20:21amalloyEvanR: ☽ 263D FIRST QUARTER MOON?
20:21technomancyisn't that ... the werewolf key?
20:21rpauloheh
20:28justin_smith🌕 is the werewolf key
20:30AeroNotixcould any one point me to where `try` is implemented?
20:31justin_smith,(special-symbol? 'try)
20:31clojurebottrue
20:31technomancyhuh, TIL
20:31justin_smiththat means somewhere in java I guess
20:31technomancy,(:added (meta #'special-symbol?))
20:31clojurebot"1.0"
20:32justin_smithtechnomancy: I found it via apropos because I wanted a way to know if something was a special form
20:32justin_smithI should do a "how to interrogate clojure" blogpost
20:32technomancyinc
20:35justin_smithI could do it all noir style. "So I'm sitting at my keyboard and up comes the most immutible lisp I've ever seen. Data structures up to here, concurrency like nobody's business"
20:36AeroNotixtechnomancy: yeah I was trying to see if I could write a slightly different try
20:36AeroNotixthen I thought that it's going to be tricky since it has atypical syntax
20:36justin_smithof all the repls in this city, she just had to dump her stack trace into mine
20:36technomancy"the most immutable lisp I've ever seen" hehe
20:37technomancyAeroNotix: take a look at slingshot; it implements try+
20:39AeroNotixtechnomancy: hm, I wanted to make the catch expression more like python's
20:48justin_smithAeroNotix: in what way?
20:48AeroNotixjustin_smith: (catch (ExceptionA ExceptionB) e ... )
20:51justin_smithAeroNotix: you could construct that with a macro, turining (my-try ... (catch [ExceptionA ExceptionB ExceptionC] e ...)) into (try ... (catch ExceptionA e ...) (catch ExceptionB e ...) (catch ExceptionC e ...))
20:51AeroNotixjustin_smith: that's what I am doing
20:52justin_smithOh, OK then :)
20:52AeroNotixbut getting the semantics of the built-in try is a bit different from a normal macro
20:52AeroNotixsince you need to parse the body for the catch expression
20:53justin_smithisn't it treated like a lambda body? in what way do you need to parse it?
20:53AeroNotixjustin_smith: because you need to know where to start looking for the list of Exception types
20:54justin_smiththe source link on thie page is messed up https://clojuredocs.org/clojure.core/try
20:55jeffterrellAh, you have to parse the body of the try expr to find where the catches begin. Is that it?
20:56AeroNotixjeffterrell: yeah
20:56AeroNotixI'm like half way done
20:56justin_smithif I was doing this, I would take the body as a list, map over it, operating on all nodes that start with the symbol catch
20:57AeroNotixthat's what I am doing
20:57AeroNotixit's simpler than i thought
20:57AeroNotixbut it's like 2am so I may leave this til tomorrow
21:15arrdemambrosebs: I feel like I owe you an appology now :P
21:15ambrosebsarrdem: no you win the awesome award
21:16justin_smithambrosebs: watching your latest strange loop talk right now, good stuff so far btw
21:16arrdemambrosebs: seriously tho if I could get core.typed dispatch I'd put that shit on everything
21:16ambrosebsjustin_smith: why thank you
21:16arrdemI suppose I owe you a few more PRs before I get to complain about limitations tho
21:17ambrosebsarrdem: it might happen during my PhD, I've entertained combining predicate dispatch and Typed Clojure with the Typed Racket ppl
21:18ambrosebsalthough that might quite be what you mean?
21:18arrdemambrosebs: threw money at you once, 8/8 would do again
21:18arrdemambrosebs: core.typed enabled predicate/patern matching dispatch would be totally awesome
21:19ambrosebshaha well it might happen again during the summer. My visa rules are pretty darn strict.
21:19ambrosebsbut I still owe everyone a bunch of videos
21:19ambrosebsI guess that's what christmas break is for
21:19arrdem:D
21:19ambrosebsyea, PhD and moving country kind of happened...
21:19ambrosebs:P
21:20arrdemhehe odds are very good I'll manage to get out without a masters
21:20arrdembut I'll be back of one
21:20ambrosebsyou're aiming for phd?
21:21arrdemprobably not, but the sort of lang/compiler stuff I think is fun is masters or better territory
21:21arrdemso who knows. I sure don't yet
21:22ambrosebswell I hope you keep it in mind. you'd probably have a lot of fun
21:24arrdemI'm sure that being a grad/phd candidate would be more fun... my primary complaint against my undergrad is the non-cs/non-research work which I find really soul sapping. :/
21:24arrdemalso you're not the first person to tell me to stick around for a PHD. peer pressure alone may yet do it.
21:24TEttingerarrdem, you've got skills for sure. It would be great to see what you come up with as a researcher
21:25TEttingerambrosebs, you're the main force behind Typed Clojure, is that right?
21:25ambrosebsTEttinger: that's me
21:25TEttingerit certainly looks good.
21:25TEttingerI haven't used it yet
21:26arrdemcore.typed is good when you have some code you know mostly works and you want to really push types through and get assurance
21:26AeroNotixI found it incredibly annoying to use
21:26arrdemI've found that because there isn't type dispatch it tends to be a little heavyweight for exploratory use
21:27AeroNotixthere's so much code out there that's untyped that you end up typing and then your code becomes a mismash of type specifiers and your real code
21:27ambrosebsit takes a while to figure out when to just give up type checking something. It can happen fairly often for certain types of code
21:27AeroNotixand then sometimes you need to change your code to make it more obvious to the type checker
21:27ambrosebsyep. That's a real problem at the moment because there's no runtime enforcement of types
21:27arrdemAeroNotix: yeah I've had a couple of those
21:27AeroNotixall in all -> don't care.
21:28AeroNotixTry it out if it works for you but for any non-trivial codebases you really ought to start off with core.typed instead of adding it in later.
21:28AeroNotixand even then the value is questionable.
21:28arrdemI mean... mad props to ambrosebs, for a project built by 1.01 undergrads it's awesome, it just needs more than one mans's worth of work.
21:28justin_smithambrosebs: how well would core.typed and prismatic/schema work together? chocolate and peanut butter or ice cream and pickles?
21:28ambrosebsjustin_smith: theoretically just fine. Right now, there's been no effort to figure out the details.
21:29amalloy(inc justin_smith) ; for lisp-noir
21:29lazybot⇒ 110
21:29ambrosebsin theory you could use core.typed to ensure you're writing the correct Schema contracts and actually using them in the right spots to prevent type errors
21:29ambrosebsthe problem is core.typed doesn't understand schemas
21:30ambrosebsand I've been apologising for that for about a year
21:30justin_smithso there would be duplicate effort
21:30ambrosebsno I think core.typed should be able to read schema definitions automatically
21:30justin_smithby duplicate effort I mean describing the same thing to core.typed and to schema
21:31justin_smithmaking core.typed understand schemas would by a one time cost that eliminates that duplication I would think
21:31ambrosebsthat's what I think.
21:32ambrosebsthe problem is that if you have no static type annotations, functions arguments would always be inferred to have type Any statically
21:32ambrosebsbecause schemas get applied in the body
21:32ambrosebsso you wouldn't get as many static type errors as you might like, but they would be turned into runtime errors
21:33justin_smithI'm still finding my bearings with both schema and core.typed, thanks for the input
21:35ambrosebsunfortunately the biggest barrier to understanding Schemas is the map schema can have more than just keywords as keys
21:35ambrosebs{:a Int (optional :b) Boolean}
21:35ambrosebsHMaps in core.typed only allow keywords
21:36ambrosebsso there's some shuffling that needs to be done, as well as figuring out how much structural equality I want to encode in the type system
21:37ambrosebsI'd hope it's downhill from there?
21:37ambrosebs:)
21:37ambrosebsvery optimistic
21:37justin_smithcool
21:38ambrosebscore.typed already understands merge/assoc etc, so that can be automated.
21:38ambrosebswhich is actually a pretty cool thing
21:39ambrosebsbeing able to understand dynamically constructed contracts
21:39justin_smithnice
21:39ambrosebs*crosses fingers*
21:40AeroNotixjustin_smith: https://github.com/AeroNotix/crap/blob/master/src/crap/exceptions.clj#L20-L36
21:40AeroNotixdespite it being 2AM (and now 2:30AM) I decided to give it a go
21:40AeroNotixthere's probably a better way to do that.
21:41justin_smithAeroNotix: looks fairly solid
21:42AeroNotixbedtime
21:42fairuzHi guys
21:43justin_smithAeroNotix: the usage of both mapcat and unquote-splicing is something I would take a second look at
21:43fairuzNormally what do you guys use to make things modular? Something like a database module, booking module etc?
21:43justin_smithfairuz: namespaces and functions
21:43fairuzOr is it not a practice in clojure?
21:43fairuzSo all of them will be in the same project?
21:43fairuzNothing like different package or something
21:44fairuzand module A add dependencies to module B, something along this way
21:44fairuzJust need some ideas on how to start off my first clojure project
21:44justin_smithfairuz: that's what namespaces are for
21:45justin_smithfairuz: using immutibility changes the game a bit, and the need for data hiding is reduced
21:45justin_smithso it's common to put multiple related functionalities in one namespace
21:46ambrosebscurious if anyone's ever been bitten by ArraySeq's in Clojure and ClojureScript being mutable if you change the underlying array?
21:46fairuzjustin_smith: Ok got it
21:47fairuzDoes we can have several files with the same namespaces? Or the namespace is tied with the file name?
21:47justin_smithnamespaces should be reflected by the file name
21:48amalloyreiddraper: i don't think i ever mentioned it to you: i think you'd be interested to know i wrote a test.check generator for instances of Thrift schemas: https://github.com/amalloy/thrift-gen
21:49justin_smithambrosebs: as I think I mentioned on twitter, I think the strong consensus is that it's something you just shouldn't be doing.
21:49ambrosebsjustin_smith: right, that's assuming *you* are the one changing the array
21:49amalloy(which could be useful for anyone who works with thrift, even if you don't really care about test.check)
21:49justin_smithambrosebs: though I could see an argument for having a warning / error if you can't prove the underlyign array does not escape scope of the immutible collection's creation
21:50justin_smithambrosebs: well the "don't do that" would extend not just to mutating it, but using something visible for others to mutate
21:50fairuzjustin_smith: ok got it. Thanks
21:51justin_smithambrosebs: that would be nice actually, now that I think about it, to warn if you are constructing something immutible using a mutable basis that escapes that scope...
21:52arrdemambrosebs: is this the aset on seq that's been floating around for a bit or is this a different case?
21:52bbloomambrosebs: i think this is a cafe of "fast and loose reasoning is morally correct"
21:52bbloomyou can do better type checking if you just assume it's actually immutable
21:53ambrosebsbbloom: sure I've come around to the pragmatics of it
21:53mindbender1,(bit-or 1 2 3 4)
21:53clojurebot7
21:53bblooms/cafe/case
21:53mindbender1,(apply bit-or '(1 2 3 4))
21:53clojurebot7
21:53ambrosebs,(let [a (into-array [1 2 3]) p (seq a) _ (aset a 0 2)] p)
21:53clojurebot(2 2 3)
21:53ambrosebsarrdem: that one ^
21:53arrdemambrosebs: yep
21:54ambrosebsbbloom: we should be able to still build a sound gradual type system that assumes seqs are immutable in the static portion.
21:54reiddraperamalloy: woah that's neat
21:54ambrosebswe basically need to track array mutations in static code, and also ensure any foreign arrays are copied before they are made seqs.
21:55reiddraperamalloy: i should create a 'test.check libraries' thing on the readme or something
21:55mindbender1sorry (apply bit-or '(1 2 3 4)) doesn't give the correct answer in cljs-repl.
21:55arrdemambrosebs: is there a compelling reason to do that rather than declare the above an abstraction fault and unsupported?
21:55mindbender1there's no way to replicate it here
21:55amalloy,(doc bit-or)
21:55clojurebot"([x y] [x y & more]); Bitwise or"
21:56ambrosebsarrdem: yes, a gradual type system is designed to protect the typed code to preserve its soundness at all costs
21:56bbloomambrosebs: would be cool if you could mark the array type as aliased to an immutable position, and then throw an error on future changes to it
21:56justin_smitharrdem: well, you could create something "immutible" from a mutible source by mistake, and get bugs later. I think the ability of static typing to detect that would be nice.
21:56mindbender1amalloy: it doesn't work correctly in cljs-repl
21:56ambrosebsso even to protect someone passing an array from the Java API to clojure
21:56bbloomambrosebs: but then of course i'm going to play devil's advocate and say that i want idempotent sets to be statically allowable ;-)
21:56amalloymindbender1: what does it produce?
21:57mindbender1it keeps producing 3
21:57mindbender1that is the first 2
21:57ambrosebsbbloom: yes that's one direction my phd could go :)
21:57ambrosebsI'll dig into linear types next year probably
21:57amalloymindbender1: the cljs version of bit-or doesn't accept multiple args
21:57ambrosebsbbloom: what do you mean by your last remark?
21:57amalloyit takes exactly two
21:58ambrosebswhat is an idempotent set
21:58bbloom,(let [a (into-array [1 2 3]) p (seq a) _ (aset a 0 1)] p)
21:58clojurebot(1 2 3)
21:58mindbender1amalloy: but (bit-or 1 2 3 4) does the right thing
21:58ambrosebsoh right an aset :)
21:58bbloomambrosebs: ^^ setting a[0] to 1 is totally safe to do
21:58bbloomheh yeah
21:58bbloomambrosebs: i would love it if you figured out how to type check transients implementations
21:58ambrosebsthat's just crazy
21:58ambrosebsyea!
21:58bbloomambrosebs: i dunno if you saw my various twitter ramblings about it
21:58ambrosebsthis all sounds related
21:59ambrosebsyes I did
21:59ambrosebsI think I briefly talked to samth about it offline. but I was despairing about mutable seqs at the time.
22:00amalloymindbender1: i see. bit-or is implemented as a variadic macro, but there's also a function version of it which only accepts two args
22:01amalloyi'd say that's a bug: the function version should accept any number of args
22:01mindbender1amalloy: is there a function I can use to work around that immediately
22:01justin_smithhow well does cljs handle / reflect the laxity about argument count in js?
22:02amalloymindbender1: (defn good-bit-or [& args] (reduce #(bit-or % %2) 0 args)) is probably fine
22:02amalloyjustin_smith: not well
22:02amalloyif you call a function with too many args, the extras just fall on the floor
22:03mindbender1amalloy: thanks it's working. I'd manage that for now!
22:16RakkoHow can I make Clojure scripts into .exes instead of .dlls using Clojure-CLR?
22:27justin_smithRakko: it looks like there was an unmerged patch for this (dunno if it really works) http://dev.clojure.org/jira/browse/CLJCLR-25
22:30justin_smithRakko: also, it looks like lein-clr generates exe files https://github.com/kumarshantanu/lein-clr
22:30justin_smithyou could use that, or figure out how it does it I guess
22:35hiredmanugh, the way pprint prints out vars is just terrible
22:35hiredmanevery time I use it I cringe
22:35amalloy,(clojure.pprint/pprint #'inc)
22:35clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.pprint>
22:36Rakkothanks, justin_smith !
22:36amalloy,(do (require 'clojure.pprint) (clojure.pprint/pprint #'inc))
22:36clojurebot#<Var@107e78: #<core$inc clojure.core$inc@f278dd>>\n
22:36justin_smith(require '[clojure.pprint :as ugly-print])
22:38hiredmanis it not the worst?
22:39justin_smithI'd hate to see the representations that weren't chosen for vars
22:39TimMcIt's ... just ... *awful*.
22:39TimMc[said in the voice of Cecil from Welcome to Night Vale]
22:39amalloy,(str #'inc)
22:39clojurebot"#'clojure.core/inc"
22:41hiredmanamalloy: what happens is vars aren't handled special they fall through to pprints deref handler
22:42hiredmanyou can actually work around it, but having to do it over and over every time you use it is not great
22:49hiredmanhttp://dev.clojure.org/jira/browse/CLJ-1576
22:49hiredmanvote early, vote often
22:51justin_smithvotd
22:52Rakkowow, there are at least two devins in the clojure world
22:58RaynesTwo whole devins???????
22:59TimMcWhat a deal!
23:00justin_smithRaynes: any big picture hints of where I would start with making lazybot use the new irclj? If not I'll just dive right in
23:00TimMcRaynes: I feel like I haven't seen you in forever.
23:00Raynesjustin_smith: One moment sir.
23:00RaynesTimMc: I'm always around. :)
23:01RaynesI just only hop in periodically. I've been rather preoccupied for a while now.
23:03justin_smithRan 0 tests containing 0 assertions. 0 failures, 0 errors.
23:03justin_smith:)
23:03Raynesjustin_smith: https://github.com/Raynes/lazybot/blob/master/src/lazybot/irc.clj
23:03Raynesjustin_smith: lazybot core is one thing, plugins are another.
23:04justin_smithRaynes: cool
23:04RaynesYou'll probably break half the plugins no matter what you do.
23:04justin_smiththat's a small namespace, promising
23:04justin_smiththat's not promising
23:04justin_smithhaha
23:04justin_smithI guess I may end up making some tests and or using schema for sanity's sake
23:04RaynesThe important thing is to get the core connection stuff moved over, get the core plugin system using the new stuff
23:05Rayneslazybot was not well written enough for unit tests to be very useful for it.
23:05Raynes:P
23:05RaynesYou can probably get a testing framework in there pretty easily though.
23:05justin_smithRaynes: this is someting I have dealt with before. I'll see how crazy it gets.
23:06RaynesWell, you can do testing plugins really easily,.
23:06justin_smithRaynes: it's an approach to code reading
23:06RaynesAll you have to do is emulate the mechanism that calls the plugin system.
23:06justin_smith"I think I know what this does, now I'll write a test to prove / disprove that" - then attempt your fix and see how the test responds
23:07justin_smithRaynes: sounds about right, yeah
23:07TimMcJust use Spring's PluginSingletonAbstractDependencyInjectionEmulatorEngineFactory to do it.
23:07RaynesTimMc: I wrote a factory for the first time a few days ago.
23:07justin_smithTimMc: oh of course, why didn't I think of that
23:07RaynesIn Python :3
23:08RaynesTimMc: https://www.refheap.com/92467
23:08RaynesLook at that shit.
23:08RaynesLOOK AT IT!
23:09justin_smithRaynes: man, if I squint my eyes I can see the conveyor belts and the little ladies with hair nets and latex gloves
23:09Raynes=D
23:09RaynesI used dropwhile for the first time in python today.
23:09RaynesThen realized getting the index of the item + using slicing was a better solution.
23:10RaynesThen I took a swig of rum and cried myself to sleep.
23:10TimMcEvery time you write the word "factory" a mid-level manager gets their wings.
23:14kenrestivohttp://xkcd.com/224/
23:14kenrestivos/perl/python/g
23:17Rayneskenrestivo: you okay bro
23:18kenrestivodoing well. laffing at your riffs on python factories etc
23:23Rayneskenrestivo: I made some tunes recently. Didn't even listen to them for quality. Sending them to you for approval. :P
23:23kenrestivomy god, this whole town just went berserk
23:24RaynesOh the sportsball
23:31chenglouhow is clojure's = implemented for collections?
23:31chengloudoes it just compare the hashes?
23:31TimMckenrestivo: Did the local sports team sports hard enough, or not hard enough?
23:31chenglouand always fast?
23:31RaynesTimMc: In PM he described it as cheering.
23:32TimMcOh good!
23:32RaynesI think that means the local sportsball team did well.
23:32RaynesAt sportsball.
23:32RaynesDunno about the rest of their lives.
23:32RaynesBut the sportsball they've solidly done well
23:32chengloualso is there any blog post explaining how the hashing is done efficiently
23:32kenrestivoif people got this excited about $thing_that_actually_matters, we'd have all the world's problems solved
23:32TimMcI'm sure they will make good decisions.
23:33TimMcchenglou: That's actually a really good question!
23:33justin_smithchenglou: it first checks for object identity, then structural equality iirc. Something to look at is hasheq as puredanger mentions here http://stackoverflow.com/questions/26622511/clojure-value-equality-and-sets
23:34justin_smithchenglou: because if the args are literally the same object, there's no need to go deeper, of course
23:36chengloujustin_smith: how is the structural equality comparison done? Just naive comparison?
23:37justin_smithchenglou: best to check the source at that point I would say
23:37chengloukk. I guess I shouldn't be worrying about perf this early on but for some random experiments I have to compare large quantities of collections against others (freshly created, no structural sharing). I was wondering if the magic of clojure's hashing could make this not slow
23:38justin_smithchenglou: well, if nothing is shared I don't know of any alternative that wouldn't involve walking every collection at least once
23:40chenglouright, but if the hash's already produced beforehand then this isn't a problem
23:40justin_smithchenglou: well, hash can only tell you there isn't a match
23:40chengloualso interested in knowing the collision rate
23:40justin_smithif it's the same hash, you still need to walk and double check
23:40justin_smithit just rules out possibilities, it doesn't mark them
23:40chengloutrue...
23:41justin_smithchenglou: puredanger could probably help you more than I but he seems not to be around, but I assume most of your answers sit in this directory here: https://github.com/clojure/clojure/tree/master/src/jvm/clojure/lang
23:43justin_smithRaynes: youre readme mentions ".lazybot/info.clj" - do you have an example or template for that file?
23:43Rayneslol my readme
23:43RaynesMy readme last updated when I was 12 or something
23:43justin_smithheh
23:43chenglouthanks
23:43amalloyjustin_smith: it's config.clj now, iirc. should be one of those in the project root or thereabouts
23:44justin_smithRaynes: is it related to config.clj
23:44justin_smithoh, got it
23:44justin_smithlol
23:44Raynesjustin_smith: It probably *is* confi
23:44RaynesOh hi amalloy
23:44Raynesjustin_smith: So amalloy apparently knows more about this bot than I do at this point.
23:44RaynesDiscouraging.
23:44justin_smithRaynes: awesome, I have my first edit going in right now (to the readme) :)
23:45amalloyRaynes: 683 commits / 145,375 ++ / 7,850 --; amalloy: 170 commits / 5,848 ++ / 5,387 --
23:45amalloyi wonder how on earth you found 145k lines to add
23:45RaynesI worked hard
23:46justin_smitha very particular coding style: (\ndefn\nfoo\n[\narg\narg2\n...]\n...\n)
23:46bbloomwtf? `lein repl` is OOM-ing on a random project of mine now
23:53bbloomdoes anybody have any ideas why i'm getting OutOfMemoryError when trying to run `lein repl` on a pretty simple project?
23:53bbloomit happens during startup, before the repl is ready
23:54justin_smithbbloom: ick - bad plugin interaction? middleware bug?
23:54bbloomthis project has no plugins or middleware
23:54bbloomgit on my dotfiles says i haven't changed my profiles.clj in 2 weeks
23:54justin_smithand nothing coming in from profiles.clj that would interact badly with that project.clj?
23:54bbloomthis project worked a few days ago
23:54justin_smithoh
23:55justin_smithsnapshot in the deps tree?
23:56bbloomonly one snapshot, and it's something that shouldn't be in any public repos, so it shouldnt' have changed
23:56Raynesbbloom: Are you by chance on a raspberry pi?
23:56justin_smithI guess you could turn on heap dumps and analyze the dump in a profiler
23:56bbloomRaynes: sometimes my mac feels as slow as a raspberry pi
23:57Raynesbbloom: lol you should try a raspberry pi
23:57RaynesI nearly tied compiling deps for a python project once
23:57Raynesdied, even
23:58chengloujustin_smith: TimMc seems like it's just plain item-by-item comparison