#clojure logs

2013-11-04

00:14bitemyappRaynes: http://logs.lazybot.org/irc.freenode.net/%23clojure/2012-11-11.txt ctrl-f "I want a driver for rethinkdb."
00:14bitemyappRaynes: no excuses. hue hue hue hue hue hue hue hue
00:14Raynesbitemyapp: Yes, and that hasn't changed.
00:15bitemyappyou has one :D
00:15RaynesIf I said "I sure wish there was a driver for rethinkdb so I could spend a bunch of time rewriting refheap to use it, that'd be great." then you should start sending me angry emails.
00:15bitemyappsorry, I'm uber excited :)
00:15bitemyappRaynes: oh no, I know.
00:15Raynes:p
00:15RaynesI'm excited about it too.
00:15RaynesJust more restrained.
00:15bitemyappI don't think I grok restraint.
00:16RaynesI've got some projects I've been thinking of doing, so it'll see use by me soon I'm sure.
00:16RaynesI just really hate to fix what ain't broken in refheap.
00:16bitemyappoh that's exciting!
00:16bitemyappTotally understandable.
00:34jared314when you manually load leiningen project middleware, is there a way to force your middleware to the first?
00:35jared314or rerun the middleware with a new project map?
00:36ddellacostajared314: what is leiningen project middleware?
00:36jared314ddellacosta: https://github.com/technomancy/leiningen/blob/master/doc/PLUGINS.md#project-middleware
00:37ddellacostajared314: ah, cool, didn't know about that.
00:37jared314trying to restructure my current lein plugin
00:37ddellacostagotcha
02:06ubikationcan someone help me figure out this code?: https://gist.github.com/ubikation/7299061 I'm getting the error: "IllegalArgumentException Don't know how to create ISeq from: clojure.lang.Symbol clojure.lang.RT.seqFrom (RT.java:505)"
02:08arrdemubikation: '(0 char-to-nums) is your problem
02:08arrdem,(let [char-to-nums :foo] (= '(0 char-to-nums) (list 0 char-to-nums)))
02:08clojurebotfalse
02:11ubikationarrdem: how do I correct that?
02:12arrdemubikation: use a sequence literal. (list 0 char-to-nums) or [0 char-to-nums] would do the trick.
02:12arrdems/literal/expression/
02:13ubikationarrdem: thanks! but I seem to still be getting a different version of that error: "IllegalArgumentException Don't know how to create ISeq from: java.lang.Long"
02:14arrdemubikation: well structurally you've got a major problem... recur doesn't do what you seem to think it does.
02:14arrdemhttp://clojure.org/special_forms#Special%20Forms--%28recur%20exprs*%29
02:16ubikationarrdem: so what do I do if I want to escape the arity?
02:16arrdemubikation: you should also probably be using reduce, rather than a recursive apply
02:16arrdemubikation: ^ that. reduce not apply.
02:16ubikationarrdem: thank you! I'll look into that.
02:19arrdemubikation: you are trying to keep a running sum here, right?
02:20ubikationarrdem: yes
02:21ubikationhmm I'm getting stuck with this small part: (reduce (fn [x] (+ 26 x)) [1 2 3])
02:22arrdemubikation: reduce takes a function f:[last-partial,this-step]->next-partial
02:22arrdemubikation: I think you want #(+ 26 %1 %2)
02:22arrdemor (fn [x y] (+ x y 26)) without the # notation.
02:23arrdemalso you don't need to (seq) a string... strings are already ISeqable so (map) will do that for you.
02:24ubikationarrdem: thank you so much for explaining things
02:24arrdemubikation: no worries mate
02:39bjaI don't think I've ever been as productive doing frontend stuff as I have recently with jquery+cljs
07:53mikerod(defrecord MyRec [x])
07:54mikerod(def m (->MyRec 5))
07:54mikerod(instance? MyRec m)
07:54mikerod(eval (defrecord MyRec [x]))
07:54mikerod(def m2 (->MyRec 5))
07:54mikerod(instance? MyRec m)
07:54mikerod(instance? MyRec m2)
07:54mikerod(= (type m) (type m2))
07:54hyPiRionwrong emacs window there
07:55mikerodhyPiRion: This is my question ... Probably should have done it differently
07:55tbaldridgemikerod: use gist
07:55mikerodhttps://gist.github.com/mjr4184/7302050
07:56mikerodsorry
07:56mikerodAlthough, I understand why m and m2 in this example are not the same instance
07:56mikerodwith how the dynamic classes are created through different classloaders,
07:57mikerodthis behavior has bit me quite a bit, with clj files being loaded from differetn classloaders
07:57mikerod"reloaded"
07:58mikerodI guess, should it just be frowned upon to use instance? checks with dynamically generated classes, like via defrecord
07:59mikerodI meant why m and m2 do not have the same `type` ***
08:16clgvmikerod: when you reevaluate a defrecord/deftype you create a new class that has just the same name but is a different class
08:19mikerodclgv: I understand that. What I'm saying is I have a clj file that had a defrecord in it. This file is used from two separate jars, the one that it is defined in, and another that is dependent on it. The second jar is loaded at runtime, and when it stumbles across a :require of this clj file, it reloads it, which reload the defrecord.
08:20mikerodSo then the second jar, creates instances of the reloaded defrecord.
08:20mikerodWhen these are passed as args to fn's from the original jar, if those functions have instance? checks on this defrecord type, they will not work.
08:39dabdwhat is the clojure operator that given (nth s [1 2 3]) would transform it into (nth (nth (nth s 1) 2) 3)?
08:41pyrtsadabd: (get-in s [1 2 3]) gets close
08:41AimHerepyrtsa, would that work on lists?
08:41pyrtsaOh, probably not.
08:42clgvmikerod: you should not have the namespace only once included in one of the jars
08:42clgv-not
08:42lisztdabd: Look at reduce.
08:42AimHere,(reduce (partial nth [:a :b :c :d]) [1 2 3])
08:42clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.lang.Number>
08:42dabdmy guess is this could be a job for the threading macros, or maybe juxt or iterate but i'm not sure how
08:42clgvmikerod: if you need the namespace with the defrecord in two jars create a lib and lot those other two projects depend on the lib
08:43pyrtsa(reduce nth s [1 2 3]) works
08:46dabd,(reduce nth [[1 [2 [3 4 5] 6]]] [0 1 2])
08:46clojurebot6
08:47mikerodclgv: Hmm the namespace is only included in one jar, I guess the way this dependent jar is being loaded is somehow circumventing the typical load-once semantics of require
08:48mikerodI'm skeptical that clojure.core/*loaded-libs* is not being shared when the dependent jar is loaded
08:49clgvmikerod: oh I had this before
08:49dabdI would like to write a function that given a possibly nested list would return me a list of the indexes of each leaf. Such that I can reduce the list with nth and those indexes and obtain each leaf. Ex: Given ((a b) c) it would return ((0 0) (0 1) (1)) because (nth (nth lst 0) 0) = a (nth (nth lst 0) 1) = b and (nth lst 1) =
08:49clgvmikerod: be sure that all namespaces with "-" use "-" in the require statements and "_" in the import statements
08:49dabdc
08:50clgvmikerod: probably worth a ticket on jira
08:52mikerodclgv: I'm fairly sure I've handled the hyphen/underscore issues, though that is a fun one :)
08:53clgvmikerod: yeah I was sure as well
08:53clgvmikerod: until I saw an underscore in *loaded-libs* after digging into it for a longer time
08:56mikerodhmm ok, I will double check on that then
08:57jcromartieam I crazy or do I remember a "named?" in clojure.core
08:58clgvjcromartie: I have the same memory but needed to use instance? lately
09:00Bronsathere has never been a clojure.core/named? AFAIK
09:01clgvmaybe it was discussed as useful inclusion
09:05llasramHot code, fresh to the githubs: https://github.com/damballa/parkour
09:05llasramAs a bonus for early users, the first 100 copies downloaded from clojars will contain a tiny fragment of my soul
09:06cemerickOK, what alternative Clojure/ClojureScript implementations/targets are people aware of? I'm pretty sure I have a comprehensive list, but I'd like to make sure.
09:06bbloomcemerick: where is your list?
09:07cemerickbbloom: nowhere public at the moment; clojurec, clojurescript-lua, clojure-py, Clojure.NET, clojure-scheme
09:08cemerickoh, four of them were in last year's survey
09:08clgvcemerick: you prepare the next survey? ;)
09:08cemerickclgv: yeah, probably going to publish later today
09:12bbloomllasram: pretty interesting stuff
09:12llasrambbloom: Thanks!
09:17bbloomllasram: also good motivation docs. i'm so glad that motivation.md or similar is something that frequently happen in this community :-)
09:18bbloomllasram: are you using this for something in particular? or was this just for fun?
09:18bbloomllasram: also, the "Reference" link in the readme is broken
09:31llasrambbloom: On my team at Damballa we've moved most of our Hadoop jobs to using this
09:32bbloomnice, good stuff
09:33llasramNot sure I how missed external-izing the Reference link... Fixed now. Thanks for catching!
09:36llasramI need to drop off for a bit, but would be glad to talk more later. I'm still in that project honeymoon stage where could talk about it all day :-)
09:43mdrogalistbaldridge: Played around with pipelining in core.asyc this weekend. I knew how to do it in theory, just never sat down to actually write the code to do it. Very fun.
09:43tbaldridgemdrogalis: take a look at core.async/pipe sometime, may help with what you were doing in the blog.
09:44mdrogalistbaldridge: Still need to take the time to look at all the new things you guys implemented.
09:45mdrogalisAh, pretty cool. Pretty much wrapped the idiom. Nice.
09:48mdrogalisAt least I remembered to use put! this time. Hah
09:48tbaldridgemdrogalis: lol nice
10:06dnolenClojureScript source maps with relative paths to original sources in master, should be good enough to integrate into web based setups - enhancement patches of course welcome :)
10:09hoeckdnolen: Great!
10:15dnolenalso enhanced :import for working with GClosure stuff more like Clojure http://github.com/clojure/clojurescript/commit/dbf31380b925815d832a6cc53364d063a59dafad
10:15dnolen:import for deftype/record dead as it never actually worked
10:16bbloomdnolen: so does that make goog.provide a future enhancement for something gen-class like?
10:20dnolenbbloom: hmm, don't think so. that's come up before, but I don't think that many people would use it.
10:20stuartsierra1dnolen: nitpicking, but `import` specifies a list, not a vector
10:20dnolenstuartsierra1: huh, but vector allowed?
10:20stuartsierra1dnolen: Yes, all the `ns`-related macros/functions are notoriously permissive in their arguments.
10:24bbloomstuartsierra1: at this point, i think the spec needs to expand. too much code just go all willy nilly with sequence literals in ns forms. there is no way it will ever change to be less permissive
10:25dnolenstuartsierra1: k, fixing that
10:25dnolenstuartsierra1: thanks
10:25stuartsierra1bbloom: Yes, but core examples should be consistent with the docstrings.
10:25stuartsierra1dnolen: thanks
10:53dabdI am attempting to use clojure.zip to solve this http://stackoverflow.com/questions/19769208/nested-list-traversal but so far I couldn't do it. Is there anyone that can show me how to use zippers for this task? Thanks
11:01dabdwhy this works ,(let [x [0]] (update-in x [(- (count x) 1)] inc))
11:01dabdbut this doesn't ,(let [x (butlast [0 1])] (update-in x [(- (count x) 1)] inc))
11:01dabd,(let [x [0]] (update-in x [(- (count x) 1)] inc))
11:01clojurebot[1]
11:02dabd ,(let [x (butlast [0 1])] (update-in x [(- (count x) 1)] inc))
11:02clojurebot#<NullPointerException java.lang.NullPointerException>
11:03andrewmcveigh,(class (butlast [0 1]))
11:03clojurebotclojure.lang.PersistentVector$ChunkedSeq
11:03rplacadabd: butlast gives you back a seq, not a vector
11:03dabdso i need to call vec on it?
11:04rplacathat should work
11:14dabdI wrote a solution to this problem http://stackoverflow.com/questions/19769208/nested-list-traversal using clojure.zip. Any suggestions for improvement?
11:15dabdIt's the first time I am using clojure.zip
11:23ubikationhello! I am having some trouble getting a somewhat simple example to work...
11:23ubikation(reduce #(+ (* 10 ( - (int %1) 48)) %2) [\0 [\4 \4 \4]])
11:24ubikationactually it's (reduce #(+ (* 10 ( - (int %1) 48)) %2) '(\4 \4 \4 \4))
11:25andrewmcveighubikation: This what you're trying to do? ##(reduce #(+ (* 10 ( - (int %1) 48)) (int %2)) '(\4 \4 \4 \4))
11:25lazybot⇒ 4492
11:34ubikationandrewmcveigh: thank you!
11:35ubikationalso what's the best way to turn a list like '((\4 \4 \4)) into '(\4 \4 \4 \4)
11:35gfredericks...with a different number of 4's?
11:35TimMcfirst
11:36TimMc(constantly '(\4 \4 \4 \4)) :-P
11:36gfredericksubikation: it's not really clear what your question means
11:36ubikationhaha yeah first is exactly what I'm looking for.
11:39TimMc&(#(`[~@%](+)) '((\4 \4 \4 \4)))
11:39lazybot⇒ (\4 \4 \4 \4)
11:39TimMc^ There's a worse way
11:43mdrogalisTimMc: You're certifiably insane. :P
11:46ubikationcan someone help me with lein? for some reason it's not working any more: https://gist.github.com/ubikation/7305498
11:46clojurebotIt's greek to me.
11:47TimMcubikation: That top-level map has :user and two {} forms.
11:47TimMcI think you want to combine those to {} forms.
11:47TimMc*two
11:48TimMc&{:user 'thing 'other-thing}
11:48lazybotjava.lang.RuntimeException: Map literal must contain an even number of forms
11:53ubikationTimMc: thanks!
11:53ubikationhey, I have this new problem though:
11:53ubikationerror in process sentinel: cond: Could not start nREPL server: Error loading ritz.nrepl.middleware.doc: Could not locate ritz/nrepl/middleware/doc__init.class or ritz/nrepl/middleware/doc.clj on classpath:
11:53ubikationjava.lang.RuntimeException: Unable to resolve var: ritz.nrepl.middleware.doc/wrap-doc in this context, compiling:(NO_SOURCE_PATH:0:0)
11:53ubikationThat's when I'm trying to jack into cider
11:57muhooTimMc: is that swearjure?
11:57TimMcIt is indeed.
11:58TimMcWhat else could it be?
12:00kolemannixSo guys. If you were to try to dress up as a monad, how would you go about doing it?
12:01TimMckolemannix: http://laurenvenell.com/wordpress/wp-content/uploads/tilted-860.jpg
12:02gwskolemannix: http://www.bostoncostume.com/images/products/7561.jpg
12:03kolemannixTimMc http://www.youtube.com/watch?v=46Z7Hq4fhN0
12:03coventry`Maybe as the Emperor with No Clothes? :-)
12:05kolemannixgwd TimMc The burrito is actually a decent idea though. Maybe both a burrito and a spacesuit in one costume
12:11gwsi think of monads more like this http://i00.i.aliimg.com/wsphoto/v0/388873690/1-Male-font-b-VGA-b-font-to-2-font-b-VGA-b-font-Female-Adapter.jpg but that's not really a costume
12:23silasdavisif I have a sorted subset of some objects and I want to an ordered list with the sorted object in their sorted order and the rest in some arbitrary order will (concat (set/difference (set all-objects) (set sorted-objects)) sorted-objects) work?
12:23silasdaviscan I do any better, will I ended up with my sorted-objects in the correct order?
12:25`cbpsilasdavis: I don't understand the question very well but have you tried it in a repl? Seems like you have the code already. Also you might wanna use sorted-sets?
12:25ubikationhow do I fix this error?: (:use [dk.ative.docjure.spreadsheet]) gives me "CompilerException java.lang.ClassNotFoundException: dk.ative.docjure.spreadsheet, compiling:(NO_SOURCE_PATH:1:1)"
12:26hiredman(:use [dk.ative.docjure.spreadsheet]) needs to be part of a (ns ...) form like it was in the example you took it from
12:26silasdavis`cbp, it seems to work in a repl, something like (concat #{ 3 9 7} [9 4 2])
12:27silasdavisI'm just wondering if under some circumstances I might end up conj'ing onto a set
12:27silasdavisand thus lose the order of my ordered items
12:27silasdavisthe only reason the set is there is so I can take the difference
12:27`cbpsilasdavis: If you want order in a set use sorted-set
12:27silasdavis`cbp, I don't want order in the set
12:28ubikationI still get the same error when I try the whole ns thing: "(ns excel-test.core (:gen-class) (:use [dk.ative.docjure.spreadsheet] :reload-all))"
12:29`cbpsilasdavis: you want the set difference between 2 vectors?
12:29silasdavisyes
12:29silasdaviswell probably a seq
12:30`cbpyou could do (remove (set v2) v1)
12:31justin_smithwhat about (concat (remove (set sorted-objects) all-objects) sorted-objects)
12:31justin_smithoh, like `cbp just mentioned
12:31jcromartieI'm not loving the mustache templating libs I've seen so far
12:32justin_smithjcromartie: what do they lack? / have that you don't want?
12:33mmitchellAnyone here using Pristmatic's "schema"?
12:33jcromartiejustin_smith: performance, consistency, resource focus, ability to use strings as keys, concurrent rendering, deref, etc.
12:33justin_smithjcromartie: I ask because I contribute to one of them that may be better, but I want to be sure before just telling you to go try that one - also whatever you need may be an improvement we could make eventually
12:33jcromartieI am going to work on my own
12:34jcromartie:P
12:34jcromartiejust to add to the mess
12:34jcromartiebut mine will be the *right* one :)
12:34kolemannixHello. So If I have a map and I want to keep all the pairs for which the key starts with the character ".", ditch the rest of the pairs, and at the same time remove the leading "." from the keys, how would I go about doing that?
12:34justin_smithjcromartie: ours is used in production, so it is pretty good performance wise, it allows for a | operator for chaining helpers, and arbitrary functions as helpers in the request map
12:35kolemannixI have a way of doing so but it's inefficient and not intuitive
12:35hfaafbkolemannix: filter then map?
12:35jcromartiebasically, I should be able to do this: (let [templ (mustache "foo.mustache")] (templ {"this" "that" :foo (future (slurp "http://example.com/bar&quot;)}))
12:36jcromartieor ((mustache (.getBytes "this is a {{test}}")) {:test "test"})
12:36kolemannixhfaafb I'm doing that already, but in a really clunky way
12:36kolemannix (let [with-dots (->> (map list lines addresses)
12:36kolemannix (filter #(= (ffirst %) \.))
12:36kolemannix flatten
12:36kolemannix (apply hash-map))]
12:36kolemannix (zipmap (map remove-first (keys with-dots)) (vals with-dots))))
12:36justin_smithI am going to test out strings as keys, I think it works with our lib, but I am not certain, I will check it out in my current project
12:36jcromartiejustin_smith: which lib?
12:36jcromartieclostache?
12:36justin_smithcaribou/antlers
12:36rasmustokolemannix: (into {} (map remove-the-dot (filter (fn [[k v]] (blah k))))
12:37rasmustokolemannix: I'd do the filter for the dot first, then the removal in the "map" step
12:37kolemannixrasmusto Ahh into. I don't use into enough
12:37justin_smithhttps://github.com/caribou/antlers https://clojars.org/caribou/antlers
12:37jtoyif i have 2 lists like [{:a 2 :foo 23} {:a 1 :foo 213}] and [{:a 2 :bar 43} {:a 1 :bar 666}] and I want to join them or group them so that I can process them grouped by a, how would I do this?
12:37rasmustoyou can use (into {}) to turn a list of keyval pairs back into the map
12:38kolemannixrasmusto thanks. that's the piece I was missing, the (zipmap keys vals) is so awkward
12:38rasmustokolemannix: notice that the filter step destructures out the key, and the map step should do the same
12:38hugodjcromartie: doesn't stencil do all that?
12:39jcromartiethere are SO MANY that I had no idea were there
12:39jcromartiewow
12:40kolemannixrasmusto thanks
12:40llasramLet a thousand templating libraries bloom!
12:40justin_smithjcromartie: I just verified, antlers works with string keys
12:40jcromartiethat's good
12:41jcromartieI don't know why so many of them expose manual caching/registration
12:41justin_smithalso notice the loop variables / aliases in the docs there, very useful
12:41justin_smithbut of course I don't gain by you using ours instead of someone elses, so just use what works :P
12:41jcromartieI should be able to do my own memoization
12:41jcromartie:P
12:41rasmusto,(into {} (map (fn [[k v]] [(str (rest k)) v]) (filter (fn [[k v]] (= (first k) \.))))) {".one" 1 "two" 2 ".three" 3})
12:41clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$filter>
12:42rasmustowhoops, too many parens somewhere, but you get the idea
12:43rasmusto,(into {} (map (fn [[k v]] [(str (rest k)) v]) (filter (fn [[k v]] (= (first k) \.)) {".one" 1 "two" 2 ".three" 3})))
12:43clojurebot{"(\\t \\h \\r \\e \\e)" 3, "(\\o \\n \\e)" 1}
12:43justin_smithrasmusto: at scale, forcing strings to/from seq is expensive, and its not like (subs s 1) is hard to do
12:44rasmustojustin_smith: probably a good point, that'd fix the (apply str (seq blah)) that I'm missing
12:44justin_smithheh, that too
12:45rasmustokolemannix: this is probably a good place to use ->>, since my mess is unreadable
12:46justin_smith,(into {} (map (fn [[k v]] [(subs k 1) v]) (filter (fn [[k v]] (= (subs k 0 1) ".")) {".one" 1 "two" 2 ".three" 3})))
12:46clojurebot{"three" 3, "one" 1}
12:46rasmustothere's nothing like a well-placed thread-last macro to brighten a monday morning :)
12:47justin_smithtrue enough
12:47kolemannixrasmusto I'll try to get a polished version working and readable and let you know when I do
12:48rasmustokolemannix: okay, I'll take a sec to let you know about refheap.com for all of your clojure pasting needs
12:55bitemyapp`cbp: alright, I pimped Revise on HN, Reddit, Twitter, and random blogs.
12:55`cbpbitemyapp: <3
12:55bitemyapp`cbp: ping me if you need anything, I know I should write some test cases to see if I can break the thread-safety of the conn mgmt.
12:56`cbpbitemyapp: ok
12:56bitemyapp`cbp: also I added an explanation of the connection mgmt model to a file called connections.md in the repo.
12:56`cbpbitemyapp: I saw that
12:57bitemyapp`cbp: it also occurred to me that a generic resource pooling library like Haskell has would be kinda sweet.
12:57bitemyappso I might consider ripping them off :P
12:58`cbpbitemyapp: would it be optional?
12:58bitemyappyeah it's not anything I'm likely to add to Revise anytime soon
12:58bitemyappand I'm not sold Revise *needs* connection pooling when the connections are lock-free.
12:58bitemyappthe connections only block for as long as it takes to send the query, not to recv.
12:59bitemyappMostly I'm just musing about it because I was watching a Bryan O'Sullivan talk and he mentioned a generic resource pooling library for Haskell that he wrote for the MySQL client driver.
12:59bitemyappagain, it's not something Revise strictly speaking *needs*, but the concept of a generic resource pooling library tickles me.
12:59bitemyappespecially if it wasn't overly JDBC specific like most are (ick)
13:00`cbpI'm not very familiar with haskell but I'll take a look
13:00`cbpnext steps are implementing continue/stop queries
13:01bitemyapp`cbp: https://github.com/bos/pool
13:01bitemyapp`cbp: the main thing conn mgmt needs is a proper error handling model.
13:01bitemyappit's ad-hoc agent recovery right now (lol)
13:01`cbp:-)
13:02ubikationcan anyone help me understand why I am getting this error?: https://gist.github.com/ubikation/7306693
13:02ubikationthank you!
13:02bitemyappand if it doesn't pan out the way I want, I might replace the agents with core.async, since I'm really using the agents for serialized message passing anyway.
13:02bitemyappthat or wrap the agent functions in a big-fat try-catch or something equally dumb.
13:03bitemyappubikation: (ns excel-test.core (:require [dk.ative.docjure.spreadsheet :refer :all]))
13:03bitemyappubikation: don't use :use.
13:03bitemyapp~use is don't use use.
13:03clojurebotOk.
13:03bitemyappokay, I'd better head to work.
13:03bitemyapp`cbp: catch you later
13:03`cbpbitemyapp: bye
13:03ubikationbitemyapp: thanks! but I'm still getting the same error though...
13:04`cbpubikation: whats you're project.clj look like
13:04`cbpyour*
13:04`cbp(assuming you're using leiningen)
13:05bitemyappubikation: if that didn't work then your classpath doesn't have the library and you didn't add the dependency to Leiningen properly.
13:05bitemyappubikation: Leiningen is configured through the project.clj `cbp mentioned, paste it on refheap.
13:05TimMc~use
13:05clojurebotI am putting myself to the fullest possible use, which is all I think that any conscious entity can ever hope to do.
13:06bitemyapp~use
13:06clojurebotI am putting myself to the fullest possible use, which is all I think that any conscious entity can ever hope to do.
13:06bitemyappgerd dermert.
13:06`cbpclojurebot: botsnack
13:06clojurebotThanks! Can I have chocolate next time
13:11kolemannixrasmusto https://www.refheap.com/20463
13:21justin_smithkolemannix: I tried a version of that using subs instead of sequence ops, and interestingly I saw little to no performance difference
13:21justin_smithI did not expect that, TIL
13:24kolemannixjustin_smith which are usually considered slower, subs or sequence ops?
13:26rasmustoyay threading, this is going to be a good week
13:27justin_smithkolemannix: in general strings are much more optimized than seqs
13:27justin_smithalso, they are immutible (one of the things vanilla java got right)
13:27kolemannixjustin_smith Underneath it's just java strings yes?
13:27justin_smithkolemannix: yes, but with a seq you force the creation of a new seq object based on the string
13:28justin_smiththen the creation of a new string out of the seq
13:28justin_smithunless that is being optimized
13:28kolemannixSure. Only makes sense if you wanna do a lot of operations on the string
13:28kolemannixfor just one operation all the conversion is overkill
13:28justin_smith*a lot of seq operations that are not also native string operations
13:29justin_smiththat is why my instinct was to use subs instead of first/rest, but I guess the jvm and/or clojure was smart enough that it was not an issue
13:29kolemannixYeah
13:29kolemannixI mean, there's gotta be a way to invoke native Java string ops using idiomatic clojure
13:29kolemannixwithout using the dot interop stuff
13:30justin_smithindeed there are... vis my version of that refheap: https://www.refheap.com/20464
13:31justin_smithfirst and rest are trivial to translate into subs
13:31justin_smith,(subs "hello" 1)
13:31clojurebot"ello"
13:32kolemannixohhh. and here I thought you just meant subs as a shorthand for java substring ops
13:32kolemannixI didn't know it was an actual function >.<
13:35kolemannixjustin_smith ran your version with subs on my actual data - got an IndexOOB exception... Another interesting factor to consider when weighting the differences of the 2 ways of doing it
13:38xeqidnolen: I've got some local clojurescript changes to make cljs.repl/evaluate-form send inline source map information to the repl-env. This makes repl interaction show source maps in the browser. I've got a CA signed, is the next step a JIRA+patch?
13:39xeqi* next step for submitting the changes
13:39bitemyapp`cbp: https://news.ycombinator.com/ look at the #2 ranked item
13:40`cbp=D
13:40dnolenxeqi: that sounds really interesting, but how does that actually work?
13:40justin_smithkolemannix: heh, ok
13:41justin_smithmust have had one letter strings as some of the keys I guess
13:41`cbpbitemyapp: maybe we could make a java wrapper and pass it off as the java driver? :)
13:41kolemannixjustin_smith I mean, I like yours better, mostly because it gets rid of the (apply str) nonsense
13:41kolemannixjust have to be careful about indices
13:41dnolenxeqi: like are you generating a source map for each evaluated form? Or you tracking things and serving a source map that's kept up to date?
13:42xeqidnolen: source map for each evaluated form
13:42dnolenxeqi: seems like the experience would be a bit strange no?
13:42seangrovexeqi: Super interesting. I saw notes on how to do that
13:42dnolenseangrove: link?
13:42xeqi combination of using a data url w/ the sourcemap base64 encoded, sourcesContent to send the form inline in the source map, and naming the eval
13:42xeqihttp://kybernetikos.github.io/jsSandbox/srcmaps/dynamic.html is one
13:43dnolenxeqi: whoa, k, yeah JIRA+patch please
13:43xeqi+ http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl for named evals
13:44xeqik, will finish clean up and make one
13:44seangrovexeqi: Yeah, that's the one I was looking for ;)
13:46dnolenxeqi: mail in your CA, I can apply the patch before it arrives.
13:47dnolenxeqi: so does this make the REPL experience significantly better for you?
13:47dnolenthis is first I've heard it can even be done
13:47xeqidnolen: signed one at first conj, so already there
13:47dnolenxeqi: oh k cool
13:48xeqibreakpoints are ify, but things like (.error console "asdfasd") are significantly improved
13:48xeqiesp when using something like austin/piggieback and resending a buffer
13:49bitemyapp`cbp: a java wrapper? hum.
13:49dnolenxeqi: ah right, hrm I suppose piggieback and others could decide to generate in memory source maps on the fly ... anyways cool stuff!
13:50bitemyapp`cbp: hypothetically, yes...I don't know if it'd be worth it because re-exposing the query DSL as native Java would lead to the same amount of work, I think.
13:50bitemyapp`cbp: I foresee lots of clojure.lang.RT :P
13:50timsgwhen writing rewrite macros that transform certain list subforms, say those starting with 'foo, is there a received way to define 'foo? Best I can come up with is (def foo `foo), but that seems weird enough to suspect unintended consequences
13:51bitemyapptimsg: don't do that @ def
13:51justin_smithwhy would you use def?
13:51justin_smitherr, what bitemyapp said
13:51bitemyapptimsg: show a before and after of what you want please.
13:51bitemyapptimsg: and do not do defs in macros or anywhere other than the top-level of a namespace.
13:51coventry`Using def makes the macro less flexible.
13:52muhoomos def
13:52coventry`def in a macro is appropriate in some circumstances. E.g., deftest, defn, etc.
13:53bitemyappcoventry`: that's not what he's doing.
13:53bitemyappcoventry`: he's using it like a let.
13:53coventry`I realize that.
13:54bitemyappthen don't confuse the matter until it becomes clear they're writing something like deftest please.
13:54bitemyappthe distinction between the scenarios might be subtle to a new person and if you inject counterexamples of when it's appropriate before they know how to make the distinction, the opportunity to correct the mistake is lost.
13:54coventry`I wasn't the one who confused the matter. :-)
13:58bitemyapp`cbp: I think the HN post got a YC bump, lol.
13:59bitemyapp0 comments, 32 points, #2 on the frontpage? has to be.
13:59bitemyappnote to self: write more libraries for YC startup products.
13:59seangrovetechnomancy: Just finished accelerando, you recommend daemon or Count Zero next?
13:59coventry`Congrats.
13:59`cbpbitemyapp: heh
13:59timsgbitemyapp, coventry: devising a small example, one sec
14:00bitemyapp`cbp: OTOH, people are starring the repo.
14:00coventry`seangrove: Are you interested in cyberpunk lit recommendations?
14:00bitemyappcoventry`: well, if he isn't, I am.
14:00seangrovecoventry`: Apparently. Getting back into fiction now that I have a kindle.
14:00indigoOh cool, RethinkDB lib for clojure
14:01bitemyappah, no wait, #1 now.
14:01bitemyappseangrove: I did the same, found it very gratifying to read fiction again, not just non-fiction.
14:01bitemyappmost relaxing leisure activity I have right now.
14:01arrdembitemyapp: congrats on frontpage
14:01indigoI wonder what kind of crappy comments you'll get :P
14:01seangrovebitemyapp: It has been strangely useful. Liking it a lot.
14:01bitemyapparrdem: congratulate `cbp, I'm just the Goebbels.
14:01indigoHN comments ftw
14:02coventry`seangrove, bitemyapp: A bit more pessimistic than Accelerando or Count Zero, but a lot of fun http://en.wikipedia.org/wiki/The_Caryatids
14:02`cbpbitemyapp: don't discredit yourself :)
14:02bitemyappseangrove: I find the relaxation of reading both very useful as well. Between that and Alan Watts talks, it's about as chill as I get :)
14:02technomancyseangrove: I haven't read daemon. I Like Count Zero a lot
14:03bitemyappindigo: haven't gotten *any* comments yet.
14:03`cbpbitemyapp: #1 now, time to look for more yc companies
14:03indigoHeh
14:03llasramseangrove: I counter-recommend /Daemon/, unless you enjoy reading hilariously bad things
14:03seangrovetechnomancy: Looking into using slamhound, read the quote, thought I should look into it
14:03seangrovellasram: Is it really bad?
14:03technomancyI couldn't get into Accelerando though; it felt too much like it was trying to cram in as many ideas per page as possible instead of building up plot and characters and stuff
14:04technomancy"traditional storytelling"
14:04winkbitemyapp: congrats :D (saw and voted on HN)
14:04indigobitemyapp: The syntax is quite different from Korma
14:04llasramseangrove: It starts off being plausible-interesting enough to forgive the cardboard characters. Ends with autonomous motorcycles rigged with swords wandering the streets
14:04seangrovetechnomancy: It got there towards the middle, the beginning was a bit weird
14:05bitemyappindigo: I'm happy with the design `cbp has put together, but it was his design, not mine.
14:05bitemyappwink: thanks!
14:05indigoAh
14:05coventry`Count Zero is pretty good, but I enjoyed his newer stuff (Pattern Recognition etc.) more.
14:05bitemyappindigo: make no mistake, I would've striven for a very similar design.
14:05winkbitemyapp: awesome readme
14:05bitemyappwink: that's also `cbp, I only wrote the connections write-up (because that was my main contribution)
14:06indigobitemyapp: It seems a bit more idiomatic
14:06winknow I only need to use rethinkdb finally
14:06arohnerman, I forgot how cool clojure.set/index is
14:06winkbeen following dev for a while.. but no project :P
14:06bitemyapparohner: *pronk* thanks for reminding me it exists :)
14:06arohner:-)
14:07bitemyappwink: no excuses now, try it out with Revise!
14:07bitemyapparohner: if you wanted to use RethinkDB, a Clojure driver exists now.
14:07bitemyappalso I'm aiming to release the migration toolkit for Datomic later this week.
14:07dnolenjonasen: seems possibly relevant for CLJSfiddle too - http://kybernetikos.github.io/jsSandbox/srcmaps/dynamic.html?
14:07bitemyappannnnnd for anybody that wants Fabric recipes for deploying Clojure stuff, I put those up last weekend too.
14:08arohnerbitemyapp: I haven't looked at rethink much, but the current theory is we're moving to datomic
14:09bitemyapparohner: very interesting, what's the origin database in this scenario?
14:09arohnerorigin?
14:09bitemyappwhat were/are you using before moving to Datomic.
14:09bitemyapparohner: still pretty happy with Datomic at my company.
14:09arohnermongo
14:10technomancy*awkward silence*
14:10dnolenxeqi: was hooking into the source map functionality simple enough for you? I'm interested in enhancements here as I think it should definitely be usable for external tools.
14:10seangrovearohner: Perf., sec., or api driven?
14:11arohnerperf & api
14:11bitemyappseangrove: maybe, "don't want to keep doing mutable bit-smashing in our data store of record" driven?
14:11gf3bitemyapp: So you're not lolreduce on snapchat?
14:11arohnerglobal write lock, all queries in production must be indexed, no history, limited search capability
14:11bitemyappgf3: I have two accounts because I fucked up. h/o
14:11noncomhi anyone familiar with seesaw? how do i pass a programmatically assembled text to a label, so that \n characters in the string would make actual newlines in the label? currently they are simply non-printed and the text is a one-liner..
14:11seangrovebitemyapp: Well, there's no DatomicHQ, sadly
14:12gf3bitemyapp: *phew*
14:12gf3bitemyapp: Did I send you the cock windmill dude?
14:12seangrovebitemyapp: I'm not totally clear on how there could be other than just a "baby's first hosted datomic", but still sad.
14:12bitemyappgf3: no
14:12gf3bitemyapp: OH SHI-
14:12bitemyappseangrove: I posted fabric recipes for Clojure and other things recently, want one for Datomic? :P
14:12gf3bitemyapp: I legit saw a guy do a windmill with his penis IRL in a club, and I snapchatted it
14:13`cbp...what
14:13seangrovebitemyapp: Would rather have Datomic-as-a-service ;)
14:13bitemyappgf3: why would you send this to me ;_;
14:13bitemyappnow I'm terrified of your snapchats.
14:13gf3bitemyapp: I thought I sent it to everyone
14:15seangrovednolen: You find you use your clojure yasnippets a lot? Looking at investing some time polishing up my emacs tools, would like to get the environment very polished for me and some new clojure/script users
14:15xeqidnolen: figuring out which dynamic vars to bind and where the line numbers came from took some source diving
14:16dnolenseangrove: I should work on them some more, I mostly like them for the ns stuff
14:16dnolenseangrove: pull requests welcome 'o course
14:16xeqibut cljs.source-map/encode + decode were useful for debugging that part
14:17dnolenxeqi: k, I'll take a look at the patch and see if there's an opportunity to clean things up
14:28myguidingstarhi all
14:28myguidingstarI want to call this method http://projects.csail.mit.edu/jwi/api/edu/mit/jwi/morph/WordnetStemmer.html#findStems%28java.lang.String,%20edu.mit.jwi.item.POS%29
14:28myguidingstarbut got this CompilerException java.lang.RuntimeException: Unable to find static field: findStems in class edu.mit.jwi.morph.WordnetStemmer
14:29llasrammyguidingstar: It's not a static method, so you need to create an instance of this WordnetStemmer class first, then invoke the method of that object
14:30myguidingstaromg my silly moment
14:31myguidingstarjava blow my consciousness away :))
14:31seangrovetechnomancy: running slamhound.el gives me an error: slamhound: Symbol's function definition is void: slime-eval
14:31seangrovetechnomancy: Looking through the issues, but not seeing much about it
14:33amalloyseangrove: you're probably trying to run a slime-based version of slamhound, but have nrepl installed instead of slime/swank?
14:33seangroveamalloy: I assume so, but kind of surprised slamhound.el would be using slime. Wonder if my package is out of date.
14:35arohneroh, slamhound is being maintained again? awesome!
14:36bitemyappseangrove: would you be okay with Datomic as a service if it was the cheap-o free instance?
14:37technomancyseangrove: iirc it falls back to slime if you dont have nrepl
14:37bitemyappI doubt DAAS is going to happen with Pro, but Free might fly.
14:38technomancyI think there's a patch I need to look at for cider support or something
14:38seangrovebitemyapp: As long as the data is backed up and I don't have to think about the system under it, yeah
14:39seangrovebitemyapp: I think the licensing makes it pretty difficult, but DAAS would be a great thing for most people
14:39timsgbitemyapp, coventry: here's a toy example, using a slightly different strategy: https://www.refheap.com/20466
14:40bitemyappDatomic's free edition license doesn't explain much.
14:41bitemyappseangrove: it's too bad I'd rather offer Simonides-AAS :P
14:44coventry`timsg: I would pass the foo symbol in as a parameter to bar. How are you planning to use this?
14:46coventry`I've done quite a lot of these kinds of transformations, in the context of trying to make an edebug-style debugger.
14:49cYmenGood evening clojurians!
14:49rasmustocYmen: morning
14:49llasram~ugt
14:50clojurebotugt is Universal Greeting Time: http://www.total-knowledge.com/~ilya/mips/ugt.html
14:50cYmenSo my goal for today is to throw together a website using clojure and clojurescript where I would have (back when I was young and needed the money) used php and javascript.
14:50bitemyappcYmen: http://github.com/bitemyapp/neubite/
14:50rasmustollasram: :)
14:50cYmenAnd I'm pretty sure many of you have done that so I would love some recommendations about how to getting set up fast and so on...
14:50bitemyappcYmen: http://www.luminusweb.net/
14:51bitemyappcYmen: http://pragprog.com/book/dswdcloj/web-development-with-clojure
14:51cYmenllasram: and don't distract me with your apropos links ;)
14:51bitemyappcYmen: https://github.com/yogthos
14:51bitemyapp~clojureweb is http://www.luminusweb.net/ http://pragprog.com/book/dswdcloj/web-development-with-clojure https://github.com/bitemyapp/neubite/
14:51clojurebot'Sea, mhuise.
14:51bitemyapp~clojureweb
14:51clojurebotclojureweb is http://www.luminusweb.net/ http://pragprog.com/book/dswdcloj/web-development-with-clojure https://github.com/bitemyapp/neubite/
14:51bitemyapp~botsnack
14:51clojurebotThanks, but I prefer chocolate
14:52bitemyappingrate.
14:52timsgcoventry: I agree one should pass the symbol triggering the transformation as a parameter in cases where it should be left up to the user, in this case I would like that symbol to be nailed down and associated with a particular namespace. I'm doing this because I'm defining a looping form that transforms into the usual loop-recur stuff.
14:53bitemyapptimsg: http://www.braveclojure.com/writing-macros/
14:53bitemyapp~bravemacros is http://www.braveclojure.com/writing-macros/
14:53clojurebotIn Ordnung
14:53arrdembitemyapp: you don't need the ~ prefix...
14:53arrdem~~bravemacros
14:53clojurebotGabh mo leithscéal?
14:54arrdem~bravemacros
14:54clojurebotbravemacros is http://www.braveclojure.com/writing-macros/
14:54arrdemi r wrong
14:54llasramIt takes a strong human to admit
14:54arrdem~botsmack
14:54clojurebotOwww!
14:54bitemyappLOL
14:54llasramhah!
14:54bitemyappI didn't know about that.
14:54bitemyappI need to read the source.
14:54bitemyappthen I can see SANBOX DENIED again.
14:55technomancyI think most of that stuff is learned facts, not hard-coded functionality
14:55coventry`timsg: Why not write the looping form as a straight macro? Why wrap every usage of (fe/foo) in (fe/bar)?
14:55arrdembitemyapp: yeah technomancy's right here. you'd have to go digging in the various dbs that backend clojurebot to see a lot of this crud
14:56arrdembitemyapp: also I demand that you supply an appropriate ~doge
14:57riley526wow such macro
14:57bitemyapp~doge is http://i.imgur.com/7iWccPN.gif
14:57clojurebotYou don't have to tell me twice.
14:57bitemyapparrdem: http://i.imgur.com/LwaMKrb.jpg
14:59hiredmanllasram: please stop
14:59bitemyapphiredman: porque?
15:00bitemyappztellman: narrator looks really interesting, why does it remind me of Riemann-as-a-library?
15:01ztellmanbitemyapp: because it's really lamina.query as a library, and you didn't know that existed
15:01ztellmanand they have a lot of overlap
15:02llasramhiredman: I didn't realize that me fiddling with querying the bot would have effects anyone else could sese
15:02llasramsee
15:02ztellmanbitemyapp: but we do use it as a pre-aggregator for riemann in a fair number of places
15:03llasramhiredman: Apparently it sets off alarm bells and rains you with nerf darts?
15:03hiredmanllasram: I'm sorry, it's fine, other things bot realated had me in a bad mood and looking at the log
15:03bitemyappthe "..." collection binding really needs to be highlighted a lot more in the Datomic docs.
15:03cYmenbitemyapp: So after looking at the links I suppose luminus is a good way to start?
15:04bitemyappcYmen: aye
15:05llasramhiredman: np. Sorry it perturbed you. I'll leave the poor bot alone for now :-)
15:06TimMcllasram: What were you doing to it?
15:06llasramTimMc: Trying to figure out how the frikkin `forget` command works
15:06TimMchaha
15:06TimMcYeah, good luck with that.
15:06amalloyoh man. i bet you made a mess
15:06llasramSo it would seem
15:06amalloyclojurebot: forget everything llasram has ever said
15:06clojurebotPardon?
15:06amalloyif only that worked
15:07TimMcYou have to surround the verb with |pipes| and there's also some other random syntax like <reply> and $who (I think)
15:07Jarda,amalloy
15:07TimMcGod help you if the factoid *contains* pipes, periods, etc.
15:07clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: amalloy in this context, compiling:(NO_SOURCE_PATH:0:0)>
15:07llasramAhhhh
15:07Jarda,(amalloy)
15:07clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: amalloy in this context, compiling:(NO_SOURCE_PATH:0:0)>
15:07Jarda:(
15:07amalloyTimMc: yeah, if the fact contains pipes i think you are basically hosed
15:08llasramI'll just leave it be for now though, read the source, stand up a local instance, then try again
15:08amalloyJarda: what?
15:08Jardaamalloy: I'm trying to find out if one can see the current value of all the incs
15:08amalloy$karma amalloy
15:08lazybotamalloy has karma 74.
15:09Jardaoh ok
15:10cYmenwow.. I did get an exception about no X11 variable being set but getting started with lumin... I don't even know the name yet! was so easy I didn't learn a thing.
15:11cYmenAlright, on to the tutorial. Brave new world indeed.
15:15timsgcoventry: it's a loop form; the 'bar is the 'loop equivalent, the 'foo is the 'recur equivalent. 'foo needs to know about 'bar, so it seems to make most sense for 'bar to be responsible for expanding 'foo. At this point it's probably best if I just hack it together and post it, then see if it makes sense. Thanks for the input!
15:27mdrogalisIs there a way with nrepl to eval a form and have its result replace the form?
15:29amalloymdrogalis: a C-u prefix in front of an evaluating command usually inserts the results of the command at point. so you could do that and then remove the original form?
15:30mdrogalisamalloy: Yeah, that works well enough. Thanks man.
15:40ShawnMcCoolis there a resource for learning clojure targeted at oop developers?
15:41brehautShawnMcCool: clojurebook.com is good
15:41ShawnMcCoolyea, that's what i've started reading
15:42ShawnMcCoolok, well thanks
15:42ShawnMcCooli still find clojure hard to grasp, but if i keep at it i'll be ok
15:42brehautShawnMcCool: heres my short summary of clojure for OOP: all the stuff you know about good design with objects is dispersed amoungst a bunch of smaller, simpler primatives but to start with you dont need any of them. learn functions, seqs and maps
15:43mtpisn't that all OOP is anyway?
15:46brehautShawnMcCool: fwiw: parametric polymorphism (ie, passing functions to other functions *handwaves*) lets you do 90% of what you normally do without resorting to anything like type directed polymorphism
15:46brehautand its a better model for reuse (in the context of pure functions)
15:47ShawnMcCoolgotcha, step one, look up parametric polymorphism
15:47brehautShawnMcCool: simple example: the map function
15:48brehaut,(map inc [1 2 3])
15:48clojurebot(2 3 4)
15:48brehaut,(map count ["abc" "def"])
15:48clojurebot(3 3)
15:48brehautmap is polymorphic on the first argument
15:49ShawnMcCooli see
15:49ShawnMcCoolthe ramifications of this are out of reach for me at this moment, but i do understand the basic concept that you're expressing
15:49brehautin OO terms: interface IMappable<A, R> { public R map() }
15:49scriptor,(map first [1 2 3] '(4 5 6) (repeat 5))
15:49clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core$first>
15:50scriptordammit, silly mistake
15:50cYmenI'm getting this error http://pastebin.com/tya4y4ik but on line 14 there is just a (defn init what's going on?
15:50brehautShawnMcCool: for that interface, imagine two implementations: one for a countable sequence, and one for a incrementable sequence
15:51ShawnMcCoolyea, that makes sense
15:51ShawnMcCoolit's a different way to describe the relationships between algorithms
15:51brehautShawnMcCool: so instead of having some types directing the usage, we have a funciton that takes that operation
15:51brehautShawnMcCool: yes
15:52brehautShawnMcCool: for the FP view of OOP, consider that objects with no setters
15:52stuartsierra1cYmen: looks like a typo, check for extraneous characters
15:52cYmenstuartsierra1: I tried but I can't find any and I understand so little of this luminus code that I can barely read anything.
15:53stuartsierra1cYmen: Sorry, don't think I can help then.
15:53brehautShawnMcCool: constructors are super important in that kind of OOP. you can put all your operations safely outside of the class (ie, in static methods) because there is no change, only the construction of new objects.
15:53cYmenstuartsierra1: http://pastebin.com/B5p7DmNi
15:53cYmenThat's what the file looks like if that helps...
15:54stuartsierra1cYmen: You have a trailing "o" character on line 30
15:54brehautShawnMcCool: from there, replace constructors with functions that return maps of keywords to values, and you are doing basic clojure
15:54cYmenstuartsierra1: impressive
15:55brehautShawnMcCool: at that point its a case of getting familiar with the standard library
15:55stuartsierra1cYmen: The error message made it clear: an undefined symbol named "o"
15:55ShawnMcCoolbrehaut: that's basically where i'm at now, getting used to the syntax and the standard library
15:55cYmenSo it tells me the problem is on 14 because that is the beginning of that function?
15:55ShawnMcCooli think that mostly the rest will come over time, i am a bit discouraged
15:55brehautShawnMcCool: awesome. sounds like you are right on track
15:55ShawnMcCoolbut, i find clojure to be fascinating nonetheless
15:56stuartsierra1cYmen: line numbers on Clojure error message are imprecise, often due to macros.
15:56brehautShawnMcCool: no need to be discouraged. may i suggest lookibng at 4clojure.com (and following some people with high scores!) if you arent already?
15:56ShawnMcCooli'll cehck it out now
15:56cYmenstuartsierra1: That's unfortunate.
15:57cYmenstuartsierra1: Thanks for your help!
15:57stuartsierra1cYmen: You're welcome.
16:01brehautShawnMcCool: one other thing: lazy sequences are away of reformulating imperative logic. learning how to think about for and while loops using the seq operations (and creating your own new operations from them) is enormously powerful. learning even one new seq function deeply often dramatically improves your FP
16:01sshackIs there a way to find out why lein (or actually heroku) isn't pulling in some of my project dependancies?
16:01ShawnMcCooli feel like your information is valuable, but i lack the concepts and vocabulary to make use of it, i'm sorry
16:02brehautShawnMcCool: thats no problem! it takes a while to pull apart a conceptual model you know well and put it back together along different lines
16:04brehautShawnMcCool: just keep at it, try some 4clojure puzzles, and maybe build a small project that you are familiar with (might be a blog or some other small scoped project)
16:07ShawnMcCoolbrehaut: yea, i mean. i feel like the difficulties that i'm having are indicative of inevitable conceptual gain. i will definitely check out 4clojure
16:07dnolencemerick: ping
16:09cemerickdnolen: hey
16:10dnolen_cemerick: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/analyzer.clj#L1193, I think part of your commit
16:10cemerickdnolen_: yeah, probably
16:11cemerickproblem?
16:11dnolen_cemerick: not sure what needs to happen here but see CLJS-640, I fixed the bad instance? cases
16:11clojurebot"There is no problem in computer programming which cannot be solved by an added level of indirection." -- Dr Maurice Wilkes
16:11dnolen_URI not hierarchical exception
16:12dnolen_cemerick: more than happy to fix it up, but just not sure what that line should be instead
16:12cemerickshit, I botched that one :-(
16:14cemerickdnolen_: I'm perhaps as much in the dark as you are. forms-seq was theoretically supposed to accept URLs (which apparently are "non-hierarchical"?), so that was my best guess at producing a "filename" for such inputs.
16:14cemericks/are/may be/
16:15dnolen_cemerick: probably makes sense to just use getPath here?
16:16cemerickdnolen_: yeah, that'd work too. I honestly don't know what the exception is supposed to indicate
16:17stuartsierra1You need more hierarchy in your URLs. I suggest switching to the feURLdal system.
16:17cemerickok, so non-hierarchical URIs are ones that don't contain slash characters; not sure how such a thing would be an input to forms-seq in the first place...
16:17dnolen_stuartsierra1: ha
16:18cemerickstuartsierra1's started drinking early, it seems
16:18dnolen_cemerick: JARs no?
16:18stuartsierra1Actually just short on sleep.
16:18cemerickdnolen_: nah, need slashes to name a resource
16:19cemerickdnolen_: maybe just (str url), and be done with it?
16:19dnolen_cemerick: k
16:20dnolen_cemerick: out of curiosity where are urls being given to forms-seq?
16:22cemerickdnolen_: analyze-file feeds it (dubiously-constructed) URLs, there may be more
16:24dnolen_cemerick: yes the URL support in analyze-file predates me if I remember correctly
16:26cemerickdnolen_: feels like it should be analyze-resource, especially if you want to drive towards using the classpath as the sole font of cljs sources
16:31brehautOS X Mavericks users: which JDK did you install? Oracle or Open?
16:32bitemyappbrehaut: Oracle, because I don't enjoy pain.
16:33bitemyappbrehaut: if this makes me a cowardly supplicant to Larry's throne, so be it.
16:33brehautbitemyapp: that is exactly my dliema; id rather open but always seems like a world of hurt
16:33bitemyappbrehaut: I offset my evil by releasing open sores libraries.
16:33TimMcHaven't had any trouble with OpenJDK over here.
16:33TimMcIs this a Mac thing?
16:34brehautTimMc: yeah
16:34bitemyappTimMc: yeah
16:34rasmustobitemyapp: another brick in the wall
16:35dnolen_cemerick: yeah agreed, will that yak for another day - just go call str on the url
16:35arrdembitemyapp: you can keep your sores, source is totally welcome tho.
16:42gfredericksI am surprised that definline is macro-style
16:43gfredericksis there a different way to do a defn that gets inlined without the manual work of the :inline metadata?
16:43hiredmanmacro style is the easiest way to do templating
16:43hiredman,(doc definline)
16:43clojurebot"([name & decl]); Experimental - like defmacro, except defines a named function whose body is the expansion, calls to which may be expanded inline as if it were a macro. Cannot be used with variadic (&) args."
16:43gfrederickssure; but you _could_ do it function-style, no?
16:44gfredericksfor the sake of being more of a drop-in thing
16:44hiredmanit would be tricky
16:44gfredericksjust transform into a let during inlining?
16:44hiredmangfredericks: you would need to codewalk the body doing gensyms, looking for free variables, etc
16:45gfredericksoooh
16:45gfredericksof course
16:45gfredericksthanks for talking me down :)
16:45hiredmanoh, by all means, make it happen :)
16:45bitemyapprkneufeld is soliciting comments for this possible entry into the cookbook: https://github.com/clojure-cookbook/clojure-cookbook/blob/master/kitchen-sink/tracing/tracing.asciidoc
16:45bitemyappanybody who's used tools.trace should take a look.
16:46hiredmanI would recommend :static instead of :inline, because if the jvm will inline it for you it will be easier, but :static seesm to be disabled in to the compiler these days
16:46cYmengreat...broke something again and now luminus is neither sending any pages back nor reporting any errors
16:46gfrederickshiredman: I was reading about that just yesterday and it sounded like it was for primitive return types?
16:47gfredericksbut this was stack overflow so it could be arbitrarily wrong
16:47hiredmangfredericks: :static?
16:47gfredericksyeah
16:47gfredericks(and also that it's disabled now)
16:47gfredericks(because the compiler is "smarter")
16:48hiredmanwell, rich seems to keep his design thoughts close to the chest, but I believe :static was sort of an initial attack on performance problems, now better served by non-dynamic vars by default
16:49gfredericksah
16:49gfredericksany knowledge how serious of a hit the existing var check is? (vs inlining)
16:49hiredman:static removed the linkage through the var (because the binding check was too expensive)
16:49gfredericksnot the binding check but just the "has this var been redeffed?" check
16:49hiredmanbut not using vars means you have sort of undesirable behaviour when you redef
16:50gfredericksfor sure
16:50gfredericksthat's why I make sure to write my functions correctly to begin with
16:50hiredmangfredericks: really, someone should write an optimizing compiler
16:51gfrederickshiredman: like for non-interactive development?
16:51hiredmanso if you don't want the dynamic overhead, *boom*, you don't have it
16:51gfredericksor "for production" rather
16:52gfredericksthat might be tricksy. alter-var-root is a big part of a lot of macros
16:52hiredmangfredericks: for people who keep opening issues in clojure's jira about statically linking functions without providing a plan or discussion of how it effects the semantics of the language
16:52hiredmangfredericks: yep
16:52gfredericksI haven't seen such issues; I guess I haven't been browsing jira lately
16:53bitemyappgfredericks: I use a fair amount of alter-var-root for things like error-handling.
16:53bitemyappgfredericks: AVR -> AOP
16:53hiredmanoh, there may just be one, but the guy opened 4-5 related issues as well, mostly "Gosh, I wish clojure did X, please make it do exactly what I want"
16:53gfredericksbitemyapp: yeah I like it for that; +1 robert.hooke
16:54hiredmanalternatively, have clojure use invokedynamic switchpoints for vars
16:54gfrederickswho was it the other day talking about using AVR for 3rd-party docstrings?
16:54cYmenAny advice on how to debug luminus?
16:54gfredericksI wonder how hard it is to export clojuredocs into a jar that does exactly that
16:54cYmenAnd by advice mean... I know nothing and haven't tried the most obvious thing
16:55bitemyappgfredericks: robert.hooke and: https://github.com/MichaelDrogalis/dire
16:55gfrederickshiredman: what's up with invokedynamic? does it just compile down to a more efficient check in the jit or something?
16:56bitemyappthe reasons we technically don't need invokedynamic are a little strange given we end up just falling back to clojure.lang.RT
16:56gfredericksbitemyapp: I've wanted something like this for logging
16:56gfredericksbitemyapp: I didn't know about dire; thx
16:57hiredmangfredericks: that is the idea, you use the switchpoint to communicate to the jit the semantics you want, and it will generate fast code that matches those semantics, I dunno how well it does at that though
16:57hiredman"you can inline this all you want, as long as you guard the inlines with this"
16:59gfrederickshuh; I didn't realize that needed to be so...hookable?
17:00hiredmanianahe (I Am Not A Hotspot Engineer)
17:01dnolen_cemerick: hmm https://github.com/emezeske/lein-cljsbuild/issues/236#issuecomment-27158955
17:01gfredericksman I wanna be a hotspot engineer
17:01tbaldridgegfredericks: graal allows some stuff like that (hooking into the JIT) but I wouldn't consider it mature yet.
17:03cYmenyay, got it working...had made a mistake with opening and closing the content block
17:04cYmenthe errorhandling was pretty opaque, though
17:05cemerickdnolen_: That whole issue is as clear as mud. Theoretically, it's a lein bug, if anything.
17:05dnolen_cemerick: k
17:05cemerickThe OP seeing it go away after a JVM update is sorta nonsensical, tho.
17:12cemerickdnolen_: FYI, going to cut a 1.0.0-alpha1 to eliminate stem the "auto is broken" issue filings. I don't want to call 1.0.0 final until 643 is done.
17:13rasmustohm, is there a way to get memoization to play nicely with functions that take a map as an argument?
17:13Apage43does it not?
17:14bitemyapprasmusto: I'm pretty sure that should just work given that map equality just works...
17:14rasmustolike a context-aware memoize that'll check whether the map is used itself, or whether just a few of its keys are
17:14peatGood afternoon (caveat timezone). Is there a preferred AWS project in the community these days? Google gives me ... many options. :)
17:14xuserbitemyapp: so your rdb client made it to HN front page :)
17:15bitemyappxuser: mine and cbp's*
17:15rasmustoI think it works if the map is 100% identical, but I have some cases where I'll pass a similar map into a fn that only uses keys :a and :b, but the map has a different :c
17:15Apage43ah
17:15bitemyapprasmusto: write a select-keys memoizing wrapper.
17:16rasmustobitemyapp: okay, sounds good. I need to drop the usage of :as in a few places, then I can do that
17:16xuserbitemyapp: that was fast, how long have you being working on it?
17:16Apage43(defn memoize-keys [f keys] (fn [m] (let [memoed (memoize f)] (memoed (select-keys m keys))))
17:16Apage43something like that
17:16bitemyappxuser: I started on it in like...May, cbp picked it up and did most of the work. I hammered out the thread-safe async connections stuff in a couple hours over the weekend.
17:16Apage43er
17:17bitemyappxuser: I abandoned it after getting burnt out by protobufs.
17:17Apage43except move the let outside
17:17rasmustoApage43: I'll take a look, thanks :)
17:17bitemyappxuser: cbp designed the actual API and did all the work.
17:18dnolen_cemerick: sounds good to me
17:18seangrovecemerick: Very cool
17:19bitemyapp70% odds I'm going to be mad at myself for not using core.async within a week.
17:19xuserbitemyapp: cool, kudos to cbp
17:20xuserbitemyapp: why did you burnout? to much things at once?
17:20bitemyappxuser: hail C(a)esar? :P
17:20bitemyappxuser: getting their janky-ass protobuf bullshit working was sanity-draining.
17:20bitemyappit was micro-burnout, not serious multi-month
17:20cYmenwhich rdp client?
17:20bitemyappI was pretty burnt out at the time though, I didn't really recover until I started at this awesome company.
17:21bitemyappcYmen: rethinkdb, not remote desktop.
17:21bitemyapprdb, not rdp.
17:21seangrovebitemyapp: If you had used core.async, then anyone requiring your lib would have pulled it in, it would have been a headache
17:21cYmenoh google auto corrected me
17:21bitemyappseangrove: I didn't use core.async specifically to reduce dependencies, but I'm not sure I like the error-handling semantics of the agent.
17:22bitemyappin fact, the only real dependency is org.flatland/protobuf, the rest is fluff other than the lein-protobuf plugin.
17:23cYmenhm..apparently I have already read the entire luminus documentation
17:24cYmenIf only I had the faintest idea how stuff works now...
17:25brehautcYmen: do you know how ring works?
17:25cYmenno
17:25brehautcYmen: start there
17:25rasmustobitemyapp, Apage43: thanks for the tips, this should do the trick
17:26Apage43okay, if you used mine make sure you actually moved the let outside the fn
17:26brehaut(cYmen: because everything else sits on top of it)
17:26Apage43it was wrong as I'd originally typed it and wouldn't memoize anything :)
17:26rasmustoApage43: yep :) I'm using a different memoize too
17:26Apage43ah
17:26Apage43cool
17:26cYmenbrehaut: hm...starting at the bottom does not work very well for me
17:27blrcYmen: it makes more sense in clj doing this than it would learning wsgi or rack first
17:27rasmustoApage43: https://www.refheap.com/20471
17:27brehautblr: hi
17:27blrring is not complex, so it's really worth reading about it
17:27blrhey brehaut :)
17:27cYmenalright
17:27brehautblr: hows the south
17:27Apage43looks good
17:27blrpretty uneventful :)
17:28brehautblr: more time for banjo then
17:28blrwe have Neutral Milk Hotel coming down here soon which is moderately exciting
17:28rasmustoApage43: I have some pretty inefficient code, I'd notice if it weren't actually memoizing something :P
17:28blrwell, there's that hah
17:28brehautblr: oh yeah nice! television must be soon too, though im not going :(
17:28cYmenhm...any advice on where to start? should I read the SPEC file?
17:29blrah, would be very cool to see them
17:29cYmenah this looks good https://github.com/ring-clojure/ring/wiki
17:30brehautcYmen: if you dont mind me tooting my own horn http://brehaut.net/blog/2011/ring_introduction is old but still largely relevant
17:30RaynesNever been much of a NMH fan.
17:30RaynesThe guy's voice pierces my brain like bullets in slow motion.
17:31rasmustoRaynes: Neural Milk Hotel
17:31blrRaynes: I live just slightly north of antarctica, so just about any band visiting is exciting (although I do love NMH)
17:32dnolen_this seems like a useful patch for someone to tidy up - http://dev.clojure.org/jira/browse/CLJS-402
17:34bitemyappRaynes: Neuter Milk Hotel more like, amirite?
17:34Raynesbitemyapp: Hurr
17:34rasmustono hurr for my version? :(
17:35RaynesI owed bitemyapp some hurrs.
17:35dnolen_CLJS-402 coupled with http://dev.clojure.org/jira/browse/CLJS-659 with remove a large source of confusion.
17:35rasmustowhat's the hurr:inc exchange rate?
17:36bitemyapprasmusto: inc me and find out.
17:36rasmusto(inc bitemyapp)
17:36lazybot⇒ 10
17:36rasmustoonly 2?
17:36Raynes$karma rasmusto
17:36lazybotrasmusto has karma 1.
17:37bitemyapp(inc rasmusto)
17:37lazybot⇒ 2
17:49hyPiRion(identity bitemyapp)
17:49lazybotbitemyapp has karma 10.
17:49rishisadhirI want to use reduce to count the number of letters in a setentence. How can I do this?
17:49brehauttrivially
17:49rishisadhir(reduce (fn [c] (if (re-matches #"[a-zA-Z]" c) (partial + 1) (partial + 0))) 0 text)
17:50rishisadhir^ doesnt work
17:50bitemyapplol wut.
17:50justin_smithrishisadhir: why regex match on a character?
17:50brehaut,(apply + (map #{\a \b \c \d} "hello world"))
17:50clojurebot#<NullPointerException java.lang.NullPointerException>
17:50justin_smithalso reduce needs an fn of two args
17:51justin_smithalso chars are not implicitly ints, they need to be explicitly cast
17:51justin_smithsolve those three problems, and you are golden
17:51rishisadhirall very good points justin, thank you
17:51brehautoh what am i doing
17:52bitemyapp,(count (filter #{\a \b \c \d} "hello world"))
17:52clojurebot1
17:53brehaut,(count (keep #{\a \b \c \d} "a b c"))
17:53clojurebot3
17:53brehauthah stupid internet lag. well snipped
17:54algernon19
17:54muhooso keep is (complement filter) ?
17:54rasmustomuhoo: remove is
17:55brehautits (comp (partial filter (comp not nil?)) map)
17:55bitemyapp,(doc keep)
17:55clojurebot"([f coll]); Returns a lazy sequence of the non-nil results of (f item). Note, this means false return values will be included. f must be free of side-effects."
17:55brehautor if you arent a muppet like me (comp (partial remove nil?) map)
17:56technomancycrazy haskellers
17:57brehautsorry
17:58bitemyapptechnomancy: prompt?
17:58seangrovebrehaut: Wouldn't (comp not nil?) be better as identity?
17:58technomancybitemyapp: point-free-ness
17:58muhooyeah, i usually use identity for preds to check for not-nill
17:58brehautseangrove: also true
17:59brehautclearly nobody should listen to a thing i say as im full of wackiness today
18:00bitemyappmake a sucky product and you get to have functions named in your honor: (defn retractions-for-old-children-because-#{VENDOR_WHO_SHALL_GO_UNNAMED}-sucks-fruit-wax [id]
18:00bitemyapptechnomancy: I love point free.
18:00technomancybitemyapp: I do too, but it's my dirty little secret
18:00bitemyapptechnomancy: too bad it's pointless...
18:01brehauttechnomancy: lol!
18:01muhoo~guards
18:01clojurebotSEIZE HIM!
18:01bitemyapptechnomancy: do ho ho ho hohttp://i.imgur.com/mZ9fRkC.png
18:01bitemyapper, http://i.imgur.com/mZ9fRkC.png
18:52Phil_DHi, everyone. Having some trouble grasping Go blocks in core.async. Wondering why I get the result here when I click the button multiple times: http://cljsfiddle.net/fiddle/phildiaz.async-help
18:53lynaghkseangrove: I don't think core.async will mix very well with Angular, which already has its own mechanism for propagating state changes
18:54lynaghkseangrove: I've sketched some things out about how to take the good parts of angular (i.e., directives) and match them up with value-oriented programming and core.async, but I haven't come up with anything concrete yet
18:54lynaghkseangrove: for the work that we do, it's very useful that Angular has a vibrant community and there are lots of plugins, &c.
18:56bitemyappseangrove: noprompt has already started working on a micro-library for two-way binding using core.async
18:56bitemyappseangrove: your best bets are to either use the aforementioned micro-library (beltway) or to use vanilla Angular + Clang.
18:57bitemyappseangrove: but yeah, lynaghk is of course quite right, mixing in core.async isn't going to happen. Angular is built on dirty-checking.
18:57Phil_Dbitemyapp, seangrove: Don't forget about Purnam: https://github.com/zcaudate/purnam -- Pretty well maintained CLJS/Angular library.
18:58bitemyappPhil_D: I forgot about purnam, thanks for mentioning it. How does it compare with Clang?
18:59Phil_Dbitemyapp: It's a lot more in line with the 'Angular workflow' if you will. It includes a full test suite, and it doesn't stray far from the writing style of plain JS.
19:00Apage43i know there's an existing thing that provides a hella-parallel (reducer capable) version of line-seq
19:00Apage43and now I'm after it
19:00lynaghkApage43: https://github.com/thebusby/iota
19:00Apage43yep
19:01Apage43thanks
19:01bitemyapplynaghk: coooool, thanks!
19:09Phil_DAnyone have an idea as to why my cljs/async example is working the way it is? I'm trying to use a loop inside of a go block (and blocking with click events) to create a simple incrementing function.
19:41seangroveHas anyone combined the fast auto mode of cljsbuild with a test runner for tdd cljs dev?
19:42seangroveAnd clojurescript.test, of course
19:43blrseangrove: do you use contracts much in testing your cljs?
19:44seangroveblr: not at all. Could be a good idea though.
19:44blryeah, seems like a potentially good thing
20:19jtoyhow is it possible to get a null exception here?
20:19jtoy,(:foo {} 0)
20:19clojurebot0
20:19jtoy,(:foo nil 0)
20:19clojurebot0
20:19jtoyhttps://www.refheap.com/20475
20:20jtoy,(:foo [] 0)
20:20clojurebot0
20:20Bronsa,(+ (:foo {:foo nil} 0) (:foo {} 0))
20:20clojurebot#<NullPointerException java.lang.NullPointerException>
20:21jtoyBronsa: thanks
20:21jtoywhat would be a safer way to write that?
20:21jtoy,(+ ( {:foo nil} :foo 0) (:foo {} 0))
20:21clojurebot#<NullPointerException java.lang.NullPointerException>
20:22Bronsajtoy: you just need to make sure you're getting a number from the map lookup
20:23jtoyBronsa: I just did this for now:
20:23jtoy(+ (or (:foo {:foo nil} 0) 0) (:foo {} 0))
20:23jtoy,(+ (or (:foo {:foo nil} 0) 0) (:foo {} 0))
20:23clojurebot0
20:24Bronsajtoy: you can replace that with just (or (:foo {}) 0), no need for a not-found key since it's going to be ok with the or anyway
20:26jtoyBronsa: thanks
20:27Bronsajtoy: keep in mind that this can still happen ##(+ (:foo {:foo :foo}))
20:27lazybotjava.lang.ClassCastException: Cannot cast clojure.lang.Keyword to java.lang.Number
20:28Bronsaif you want to be 100% safe, just (assert (every? number? (vals your-map)))
20:34hiredman,(doc fnil)
20:34clojurebot"([f x] [f x y] [f x y z]); Takes a function f, and returns a function that calls f, replacing a nil first argument to f with the supplied value x. Higher arity versions can replace arguments in the second and third positions (y, z). Note that the function f can take any number of arguments, not just the one(s) being nil-patched."
20:36beppu,((fnil + 0 0) (:count match) (:mention_count match))
20:36clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: match in this context, compiling:(NO_SOURCE_PATH:0:0)>
20:38beppu,((fnil + 0 0) (:count {:count nil}) (:mention_count {:count nil}))
20:38clojurebot0
20:40jtoyBronsa: i dont think I will need that level
20:44gunsI'd like to hack on clojure.lang.Compiler in conjunction with a leiningen project; is this as simple as setting :source-paths and :java-source-paths to my clojure checkout?
20:44hiredmanguns: that is going to be tricky
20:45gunshiredman: so just compile and reload?
20:45gunsI guess I could just import the relevant bits to the clojure repo
20:46hiredmanguns: that may be easiest
20:46gunsokay, thanks for saving me the headache
20:47hiredmanwell, actually, I guess it has been a while since the last time I tried that
20:47hiredman(3 years)
20:47gunsI suspect not much has changed in this regard
20:48hiredmanwell, if I recall at the time the issue I had was with lein getting confused about where it was pulling clojure from on the classpath, that may have all been sorted out
20:49dnolen_boom, runtime obtainable CLJS compiler version - compiler fixed to recompile if compiler version doesn't match tagged JS file on disk http://github.com/clojure/clojurescript/compare/89aef54a9d...73810450cd
20:49dnolen_should eliminate a lot of unfortunate confusion
20:50jtoyis there a method to return the first match from a list but not process all of them, in ruby there is detect which is like (first (filter ...))
20:50dnolen_jtoy: some
20:55jtoydnolen_: thanks
20:57blrdnolen_: just out of interest, are you still mulling over a blog post on the virtues of frp over clientside mvc? :)
20:59blrseem to recall some mutterings about that at some point
21:07dnolen_blr: haven't put much more thought into, busy with CLJS compiler enhancements
21:07blrwell fair enough :)
21:07dnolen_xeqi: CLJS-658 needs to use tools.reader, otherwise looks good
21:09xeqidnolen_: ah, right. Also realized I sent it with some absolute references to cljs.sourcemaps/encode, would you prefer that to be :require'd and used by an alias?
21:09dnolen_xeqi: preferred yes
21:13bbloomdnolen: is there a ticket for the catch :default thing? i've got an itch to write any code that isn't js/rb right now, so i might hack that one out fast
21:13dnolen_bbloom: there's not a ticket yet
21:13dnolen_?
21:13dnolen_yeah pretty sure there isn't
21:16l1xhey
21:29jcromartielet's talk about parsers…
21:31bbloomyes. let's
21:32bbloomi hate ad-hoc parsers
21:32bbloomnightmares.
21:32jcromartie:P
21:32jcromartiewhat's an ad-hoc parser?
21:32jcromartie(as opposed to what)
21:33bbloomhttps://github.com/clojure/clojurescript/blob/master/src/clj/cljs/analyzer.clj#L387-L413
21:33bbloomblargh.
21:34jcromartieyikes
21:41akhudekhmm, getting an out of heap space error compiling clojurescirpt
21:41akhudekwith cljsbuild
21:41akhudekbut only apparently in my environment
21:41dnolen_akhudek: other people have reported this - seems related to source maps
21:42dnolen_akhudek: but I haven't anything remote resembling a detailed report, out of heap error seems ridiculous given the size of the source map
21:43dnolen_"haven't seen anything remotely a report"
21:43akhudekdnolen_: think we're still pre-source map
21:43akhudek1859
21:43dnolen_akhudek: strack trace is useful
21:44dnolen_akhudek: two other times I've seen it - very deeply nested list comprehensions and core.match before I fixed a bug.
21:45`cbpbitemyapp: sick pr :-) we got a lot of stars
21:46akhudekdnolen_: https://www.refheap.com/d1ecf744319b327d1df8aaebc
21:46akhudekdnolen_: seems to be failing on random files each time I try
21:47akhudekdnolen_: e.g. https://www.refheap.com/768928063454286813aff58c3
21:49dnolen_akhudek: did you try increasing the JVM heap size, are you monitoring the process to see that it actually grows large?
21:50dnolen_akhudek: also would be useful to see your project.clj
21:54dnolen_akhudek: that last exception also looks like you've trigger the jar walking that finds all JS files in a jar :P
21:54bitemyapp`cbp: thanks, we did indeed get quite a few :)
21:55akhudekdnolen_: visualvm seems to suggest it's using less than 14mb in total, trying again since that doesn't seem right
21:56dnolen_akhudek: and does visualvm show you what options the JVM was started w/ ?
21:57akhudekdnolen_: it does, but it doesn't specify a memory limit so it must use the defaults
21:58dnolen_akhudek: so try :jvm-opts ^:replace ["-Xmx512m" "-server"] in your project.clj
21:58dnolen_akhudek: note ^:replace
21:59akurilin2So, I'm not very familiar with this whole area of the language, could use a pointer. What output stream do I use if I want to make a file downloadable from a Ring application?
22:00brehautakurilin: a file file or something that will become a file for the user?
22:00akurilin2brehaut, in my case I'm just generating a pdf on the fly based on a GET
22:01akurilin2brehaut, and I want to return that blob right away and avoid storing it anywhere
22:01dnolen_xeqi: you're still using the line numbering push back reader from Clojure, tools.reader has a better version of that
22:01dnolen_xeqi: checkout form-seq in cljs/analyzer.clj
22:02dnolen_er forms-seq
22:02brehautakurilin2: i'll have a quick spelunk
22:04akurilin2I think Ring lets you return a BufferedSomethingStream in the response and then it will magically convert that to the right thing
22:04brehautakurilin2: yeah, i think it might be any input stream
22:04akurilin2however I'm not quite sure how to deal with my output stream situation. As in, I pass an output stream into the pdf generator function, then what?
22:04brehautyeah, any inputstream, so bufferedinputstream is probably the one to use
22:04akhudekdnolen_: that doesn't seem to apply to the lein process itself
22:05akhudekdnolen_: heap is still at 48mb and the child process lein spawns for cljsbuild does bust that limit
22:05brehautakurilin2: ugh. java streams always confuse me
22:06akhudekdnolen_: oh wait that did fix it, thanks
22:07brehautakurilin2: sorry i cant help any more
22:07akurilin2brehaut, heh yeah. All I want is to dump the thing to a byte array and dump the byte array back out to the caller
22:07akurilin2brehaut, no worries, that helped a bit :)
22:08brehautakurilin2: you could do perhaps (ByteArrayInputStream.(.toByteArray out-stream)) ;; from http://data-sorcery.org/2009/11/29/incanter-webapp/
22:08brehautbut it should be possible to do it lazily
22:08akurilin2brehaut, as in, the data would be generated in parallel to Ring spitting the bytes out, right?
22:09brehautakurilin2: yeah; rather than generating it all to a honking large array
22:09brehautand then spitting it out
22:09xeqidnolen: just to confirm, you're refering to using readers/indexing-push-back-reader rather than LineNumberingPushbackReader. ?
22:10amalloyyou can use a pair of PipedInputStream/PipedOutputStream, spin off a thread to write to the output, and give the input to ring
22:10amalloythat's blocking/lazy
22:10amalloyi have an example in https://github.com/amalloy/ring-gzip-middleware/blob/master/src/ring/middleware/gzip.clj#L38, but it's a little messy - i think there's another one in ring or compojure somewhere
22:10akurilin2amalloy, interesting! Man how many types of stream are there out there :|
22:11seangroveWhat would the equivalent of javascript's: value &= 0x80, value |= 0x80, in clojure and clojurescript?
22:11amalloyakurilin2: unbounded
22:11brehautakurilin2: there are two types of stream per direction for every type in java
22:12akurilin2Java people are at a serious advantage here when looking at this stuff :)
22:13akurilin2amalloy, why would it deadlock? Not seeing it right away.
22:16akhudekhmm, so I haven't solved this
22:17akhudeklein is still getting only 48mb of heap
22:18enzoaquinoanyone happen to be using lobos (db migration library) with heroku?
22:19enzoaquinoHaving an issue where lein ring server runs the migrations fine. But when it's compiled first, then run via the lein trampoline ring server, it doesn't find any migrations.
22:22sritchieseangrove: hey! I think I fixed the AOT thing
22:23seangrovesritchie: Oh? What was it?
22:23sritchieI had had "^{:skip-aot true}" in my :main method, for ring
22:23sritchieBUT then I was calling :aot :all
22:24sritchieso I think that was getting excluded, thereby compiling the clojure.tools.reader classes at different times
22:24sritchiethat used to be in the noir docs,
22:24sritchieso my guess is you may have the same issue
22:24ddellacostaenzoaquino: that is not to do with heroku, it is a problem with lobos: https://github.com/budu/lobos/issues/51
22:25ddellacostaenzoaquino: I would steer you away from using it, honestly--I've found it to be a frustrating lib to use on a number of levels. I'd suggest instead checking out ragtime: https://github.com/weavejester/ragtime
22:25sritchieseangrove: how's that guess?
22:25enzoaquinoddellacosta: thanks! I kind of ended up choosing it because it was in the luminusweb documentation. I'll take a look at ragtime.
22:26akhudekaha, figured it out
22:26seangrovesritchie: interesting! Let me check...
22:26akhudeklein doesn't set a default -Xmx flag
22:26akhudekand if you happen to have not much memory free
22:26akhudekthen java will allocate you absurdly small heap space
22:27akhudek(even though you have plenty of swap space left!!)
22:31akhudekoh foul, cljsbuild doesn't honour LEIN_JVM_OPTS
22:35dnolenakhudek: this seems like a lein bug, technomancy? https://github.com/emezeske/lein-cljsbuild/issues/261
22:35dnolenor a bug between lein and plugins
22:35bitemyappdnolen: maybe when Leiningen spoke the language of the system - it stuttered?
22:36akurilin2amalloy, btw looks like there might be something in Ring already to take care of what we were talking about: https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/util/io.clj#L11
22:36akurilin2might be misreading it though.
22:37amalloyyep. i did say there's one in either ring or compojure; that's it
22:39bbloomdnolen: i got mega side tracked, but i think i have a decent patch
22:39akurilin2amalloy, got you, perfect!
22:39akurilin2thx
22:39dnolenbbloom: cool
22:39akhudekdnolen: yep, that's the problem, thanks! Setting JVM_OPTS works as a work around I think.
22:40bbloomadds more code than i'd like, but i can't think of any shorter way to do it w/o losing a lot of clarity
22:44bbloomdnolen: http://dev.clojure.org/jira/browse/CLJS-661
22:44bbloomdnolen: i basically built a little regex state machine
22:45bbloomsince the parse logic was out of control & overly permissive
22:46bbloomso this will also cause "Invalid try form" to show up in several cases where other less sensible errors would happen
22:47dnolenbbloom: nice, thanks!
22:51dnolenakhudek: https://github.com/technomancy/leiningen/issues/1364
22:55abaranoskyamalloy: are you around? we're trying to get lein-protobuf working for some work stuff, but when I run `lein protobuf`, I see tons of Java compilation errors
22:57amalloyabaranosky: i know ninjudd made some changes to lein protobuf recently, because the old version doesn't work on latest OSX
22:57amalloybut lein protobuf is not something i know much about, myself
22:58akurilin2Ah, just discovered that compojure by default merges route params into the params map. That's pretty darn helpful.
22:58abaranoskyamalloy: hmmm... I' haven't upgraded just yet to the new OSX
22:59abaranoskyamalloy: I can just keep digging.. I'm just havign a hard time differentiating between things I'm doing dumb, and whether there might be something wrong in the library
23:00amalloyabaranosky: well, you could gist some error messages and i can take a look
23:01bitemyappabaranosky: we used lein-protobuf in Revise, could you see if it breaks for you?
23:01bitemyappabaranosky: lein-protobuf worked fine for me on Mavericks and I don't think cbp is using mavericks.
23:01bitemyappabaranosky: if you clone Revise and run the tests, that might provide more information.
23:06abaranoskybitemyapp: I'll try that... let's see
23:07abaranoskybitemyapp: at the minimum I'll be able to compare how Revise sets things up
23:09abaranoskybitemyapp: looks like yours compiled excellently
23:09abaranoskylet me compare jars versions
23:15abaranoskybitemyapp, amalloy: I just removed some dependencies from my project file, and reran lein protobuf... it looks to have worked
23:15abaranoskystinkin transitive dependencies!
23:17bitemyappabaranosky: use lein-pedantic next time maybe?
23:18abaranoskybitemyapp: the sick thing, is that I just uncommented them one by one, and now it is working with none commented out!
23:19abaranoskythere must've been some kind of compile artifact left in some out of whack state
23:19bitemyapp*whistles*
23:19bitemyappabaranosky: did you try lein clean?
23:19abaranosky*whistles too*
23:20abaranoskyyeah, lein clean... dunno, don't care right now, as long as it stays working... I've been switching through different versions of the plugins... probably when I switched to the jars used in Revise, then I cleaned after and it started working
23:21bitemyappabaranosky: well I'll chalk it up as having needed a lein clean or different version. T'was just curious.
23:21abaranoskyyep, and I'd be curious normally too, but in a bit of a rush at the moment :)
23:21bitemyappabaranosky: amusingly, my other primary contribution to Revise other than connection management was getting fucking protobufs working.
23:26abaranoskybitemyapp: working on an initial stubbed out version of a new identity service
23:27abaranoskyjust a service to keep track of users across our different web services
23:29`cbpbitemyapp, abaranosky I do use mavericks but i did not use it to run lein protobuf
23:29`cbpAs a side note I never did manage to get the damn thing to run on windows
23:30`cbpI even modified it to override the script but compiling C/C++ things on windows is a nightmare
23:30abaranosky`cbp: friggin windows
23:31`cbpabaranosky: are you on windows?
23:31abaranoskyis the pope a satan worshipper?
23:31`cbpoh nvm
23:31abaranosky:D
23:35muhoobitemyapp: fyi lein pedantic is depreciated. now it's :pedantic? true in project map
23:36sritchieseangrove: any luck?
23:37seangrovesritchie: Sorry, was running a grep. Doesn't look like I have :skip-aot anywhere in the code base :P
23:37sritchieugh
23:37sritchienot in project.clj, that is
23:38seangroveYeah, grepped across all of our clojure projects
23:38bitemyappmuhoo: oh, thanks!
23:38sritchiebummer
23:38seangrovesritchie: Thank you though, no worries :)