#clojure logs

2011-09-19

00:11archaiichi, anyone experienced with google app engine here?
00:16brehaut~anyone
00:16clojurebotPlease do not ask if anyone uses, knows, is good with, can help you with <some program or library>. Instead, ask your real question and someone will answer if they can help.
00:18archaiic using appengine magic, I send an XHR request that works in interactive and development modes but fails in production, any advice? i think it might be due to gae whitelist
00:21amalloyae-magic does some weird stuff to detect whether you're in production or not, is what i heard last time someone had an issue like this
00:22amalloy~search for ide sniffing
00:22clojurebot<#clojure:shtutgart> zvrba: well, maybe it's because clojure seems the most popular and practical lisp right now, but if you just want to learn new concepts etc, Racket will be just fine (simple, no java, batteries including ide)
00:22clojurebot<#clojure:konr> what text editor/IDE do you use?
00:22clojurebot<#clojure:raek> ae/start is conditionally compiled and is only there if ae-m thinks you are using an IDE
00:22clojurebot<#clojure:raek> maybe this is the "IDE sniffing" appengine-magic does
00:24tomojwhoa
00:24tomojbrilliant
00:25archaiicemacs
00:33michaelr525good morning
00:39archaiicUpdate: I can get XHR request to work in production without using a json response - using json still throws a 500, possibly clj-json.core uses classes not on GAE whitelist?
00:42brehautclj-json uses the jackson library doesnt it?
00:44archaiicyes
00:44archaiicit imports java.io StringReader and BufferedReader both are fine
01:18archaiicahhh that was the worst thing I had to debug in a real long time for anyone interested clj-json 0.4.3 doesn't seem to run on GAE, use clojure-json instead
01:23michaelr525why use GAE anyway?
01:23archaiicslightly tied into datastore right now
01:24archaiicand some other of their services
02:12cemerickIt's all dnolen's fault. Scotch and such.
02:13michaelr525functional scotch?
02:14cemerickhrm, presumably
02:15cemerickmaybe scotch provokes imperative thinking
02:15michaelr525hhhh
02:15cemerickThat's all speculative.
02:16cemerickIt might have been the five margaritias too.
02:16cemerickThe data is inconclusive.
02:17michaelr525dnolen quit first ;)
02:17cemerickHrm, I wonder what hypothesis that supports.
02:25michaelr525cemerick: The hypothesis of getting up to work in the morning..
03:31NanakhielChousuke, Juumalan kyrpä, eestilaiset on tulevat! miehitä tykit!
03:43michaelr525Nanakhiel: Potato chips? What do you mean?
03:47opqdonutthat was some very disconcerting stuff in finnish
03:50Nanakhielopqdonut, what does disconcerting mean?
03:50opqdonutdisturbing
03:51NanakhielReally?
03:51NanakhielWhy so?
03:51opqdonutwell you don't usually encounter people saying "the penis of god" followed by blabbering in #haskell
03:52opqdonutsory, #clojure
03:52opqdonutgot my contexts mixed up again :)
03:53ChousukeThis guy likes to say random offensive things in Finnish to me for some reason.
03:53NanakhielYour standards of offensive are peculiar
03:53NanakhielI would losely translate as 'omg, the estonians are coming, man the cannons!'
03:54Chousukevery loosely.
03:54NanakhielOf course.
03:54NanakhielLiteral translation always fails one.
03:54opqdonutoh, Chousuke is finnish. I had no idea
03:54raek"Nanakhiel"... another one of you nicks?
03:55Nanakhielraek, one of the many names I had throughout the milennia.
03:57michaelr525what did I miss? ;)
04:18sthuebnerhow do I parse a large xml file (larger than memory) lazily?
04:19sthuebnerI'm using clojure.contrib.lazy-xml together with clojure.contrib.zip/xml-zip, but it blows up heap memory
04:20amalloyi would be pretty surprised if you could zip lazily
04:20amalloysince the zip api has ways to go up and down in the tree, you can't throw away elements you're "done" with
04:21sthuebnerzip-filter/children reads as it would return a lazy sequence of children.
04:21amalloyso?
04:21sthuebneryou're saying that it nevertheless has to parse the whole file?
04:21amalloyno, it has to hang onto the whole file in case you decide to go back up towards the root
04:22sthuebnerOK, I see. so zippers are the wrong path to go then
04:22amalloyyes
04:22sthuebnerwhat other option do I have?
04:24amalloydunno. it is xml's nature that it's pretty hierarchical
04:25amalloyhttps://github.com/clojure/data.xml/blob/master/modules/xml/src/main/clojure/clojure/data/xml.clj has some code that looks like it's supposed to parse things lazily, but (a) doesn't have any released versions yet, and (b) i'm not really convinced it would work
04:26amalloy$google xml sax
04:26lazybot[SAX] http://www.saxproject.org/
04:26sthuebnerOK, I'll take a look on that
04:26amalloyof course that's very stateful and low-level/unpleasant
04:27amalloybut i'm not sure you have have both the convenience of hierarchical-looking structures *and* lazy parsing
04:28sthuebnerI don't really need the whole structure, but just a sequence of children of the root element. each of these is of reasonable size
04:29amalloythen just lazy-xml/parse-seq looks like it should be sufficient
04:40khaliGwhen using clojure-jack-in - is there a way to restart everything? i've added a new jar to lib and want it to pick it up
04:41khaliGor if there is some other way to do it short of restarting emacs i'd like to know
04:44amalloyi think you just kill the *swank* buffer
04:45khaliGamalloy, wicked, that'll do
04:59michaelr525sthuebner: maybe lazy-xml already does it. but I remember that i looked into this stuff when I had a similar problem: https://github.com/marktriggs/xml-picker-seq
05:05sthuebnermichaelr525: thanks, I've just discovered xml-picker-seq myself. I'll check it out
07:47dzderichere's a question: What's the best way to do distributed web scraping in clojure?
07:47dzdericI'll be scraping sites where some workers will download lists of URLs for other workers to grab, parse and insert into a db
07:48dzdericI was thinking of using redis as a queue, although I don't know if it's reliable enough
07:49dzdericor should I really be using hadoop for something like this?
07:51michaelr525dzderic: i'm currently looking into kestrel as a reliable queue for other purpose, but maybe it would be good for yours as well..
07:54dzdericthe main concern I have with reliability is that I want this to run on EC2 and have the IPs of the workers change every couple of hours
07:54dzdericand I'm not really sure on how I would go about implementing this
07:58chridowhy not use the amazon queue?
07:59dzdericwould it be fast enough?
08:01chridofor me it's enough (~10-150 msg/sec), don't know your requirements
08:02dzdericthat should be fast enough
08:02dzderici'll check it out
08:07michaelr525dzderic: or your own queue such as kestrel, saving to amazon EBS (persistent storage). I think it will cost you less than amazon queue
08:07michaelr525dzderic: please let me know what you find out :)
08:08dzdericmichaelr525: I just realised I will be well above the free tier :S
08:08dzdericmichaelr525: I'll check out kestrel
08:17dzderickestrel looks very simple
08:18dzdericthe only problem with it is that it has no equivalent of redis' "BRPOPLPUSH", which retrieves an element from a list and pushes it onto another one (eg. "currently processing"), which helps to make sure every link gets processed
08:21thorwilis there a nicer way for something like : (map #(vector %1 %2) [:a :b :c] (range)) ?
08:22michaelr525dzderic: well, from what I read I understood that you can pop an element from the queue and process it and when you are finished with it you signal the queue and only then it is removed from the queue..
08:23michaelr525it's called reliable reads I think
08:23dzdericmichaelr525: i saw the peek command
08:23dzdericmichaelr525: which could help[
08:27bhenry,(map vec (zipmap [:a :b :c] (range)))
08:27clojurebot([:c 2] [:b 1] [:a 0])
08:27bhenrythorwil: ^^ ?
08:28bhenryyours might be faster though. less work i think.
08:30thorwilit's interesting and a good reminder of zipmap (which belongs to the collections of things i tend to forget), thanks :)
08:31dzdericbhenry: note that your implementation returns a reversed vector
08:31dzderics/vector/list
08:31lazybot<dzderic> bhenry: note that your implementation returns a reversed list
08:32bhenrydzderic: i noticed that. sometimes that doesn't matter.
08:32dzdericfair
08:33bhenryi should have told thorwil to note that in case it matters for him
08:33thorwildo i see this correctly, that additional bindings in a for are executed in a nested fashion?
08:34raek,(map-indexed vector [:a :b :c])
08:34clojurebot([0 :a] [1 :b] [2 :c])
08:35bhenryraek: nice.
08:35thorwilindeed
08:54fhdIs there something like a (def-) to define private variables, like (defn-) for private functions?
08:55manutterfhd: that's a frequently-asked question, and the answer I usually hear is "No, but it's easy to make one if you really need it"
08:56manutterprivate vars make it harder to write tests though
08:56fhdmanutter: I see. Was wondering because googling around didn't give me much.
08:56manutteran alternative is to make a namespace foo and a namespace foo.impl, have foo require foo.impl, then put "private" vars in foo.impl
08:56fhdmanutter: Yeah, I haven't needed this in 12 months of working with Clojure, but right now I do. I need a simple in-memory storage for test purposes.
08:57manutterfoo.impl is "private" since nobody else calls it, but still public enough that your tests can require it
08:57fhdmanutter: That's how they do it in C++ :)
08:57manutteryeah, the "impl" rang a bell when I first saw it
08:58fhdmanutter: I like that solution, guess I'll use it for all of the storage related functions
09:00Kototamahello, in compojure i'm having my POST parameters indexed on a string when using swank but on keywords when building a WAR. Why is it so??
09:00lazybotKototama: What are you, crazy? Of course not!
09:01manutterbotsmack
09:03manutterKototama: classpath issues?
09:03manutterI'm taking wild guesses, that sounds like a very weird problem to me
09:07Kototamathese are the parameters within an wrap-multipart-params
09:09manutterThe only thing I can think of is there's an older version of wrap-multipart-params in the classpath that the WAR/servlet-container sees, which is different from the version in the classpath that slime/jetty sees
09:09manutterbut like I said, wild guess
09:11Kototamai'm using jetty7, could this be related?
09:15manutterI couldn't say
09:17xianHi. I have a leiningen project where Java and Clojure code are mixed. Compiling the Java code requires some jar-file to be in the classpath. However, leiningen seems to have its own classpath and typing "lein javac" leads to many compiler errors (because the required jar file is not in leiningen's CP). Is there any way to modify leiningen's CP?
09:18manutteryes, there is, but you're going to ask me "what is it" and I don't remember :(
09:19manutterI think there's a tag in the leiningen examples project.clj file, on the leiningen site
09:22raekxian: the simplest way is to find the artifact id for your jar and add it as a dependency in your project.clj (if the jar is available in a maven repo somewhere)
09:23raekxian: if you search for the jar at http://www.jarvana.com/, is it there?
09:24raek(this is the most common reason to want to include an external jar that I hear of)
09:24manutteroh, yeah, that'll work! :) I'm pretty sure there's a project.clj key for it too, though. Maybe :library-path ?
09:28raekxian: in case the jar is not available as a maven artifact, it should be possible to add it to the lein classpath somehow, yes. (I don' recall exactly how to do it now, but I know where I can look)
09:30joegallomvn install the thing, and then, hey presto, it is available. the output from the maven error messages tell you how to do it.
09:32manutterYeah, I just put it in as a dependency in project.clj, and then the error message from 'lein deps' gives pretty precise instructions on how to install it
09:33manutterI did javamail that way, come to think of it.
09:33manutter(before I knew how to search for the right maven repo ;)
09:34xianraek: I just copied the jar in the libs directory and it worked.
09:34xianraek: I will look into your suggestions later today, thanks so far.
09:34manuttereh, but keep a spare copy around, lein has a tendency to wipe out the libs dir and rebuild it from scratch
09:37raekxian: beware that leiningen will remove that jar when you do a lein deps. (there is an option for that)
09:37joegalloxian: that is a solution, but it's not a good one for anything besides an immediate fix, because of what manutter said. the lib dir is not for you to add and remove things from, you should treat is a magic black box under the management of leiningen.
09:38manutterraek: you added info that I forgot, though, so it's all good
09:41chridoa question: which application server would you use on windows server?
09:42chridoit's a small web application with a db behind
09:44manutterchrido: you mean like tomcat vs jetty? I'm not clear on "application server on a windows server"
09:45chridoyes, tomcat, jboss and so on
09:46chridogeronimo
09:46chridoor glassfish?
09:49manuttereh, I don't really know enough to have an informed opinion, I should just keep my mouth shut.
09:50manutterI do like heroku for clojure tho ;)
09:51chridosomething like that would be great, but running on a windows box.
09:53manutterwell, the point of heroku is letting someone else maintain the box. If you've got your own server I would think tomcat or jetty would suffice, unless you need the extra services that come with jboss/glassfish
09:53manutterdon't really know much about geronimo
09:56zippy314Can anybody tell me the correct way to serialize a clojurescript hashmap to a Json string? My current attempt, an example of which is: (goog.json.serialize (.strobj {:cmd "authenticate" :params {:user "eric"}})) , produces a very weird json string: {"\ufdd0'cmd":"authenticate","\ufdd0'params":{"meta":null,"keys":["\ufdd0'user"],"strobj":{"\ufdd0'user":"eric"}}} Notice the \ufddo' before all key values, as well as the "m
10:00chridomanutter: just found out there exists a windows service wrapper for jetty, so there could be a possibility that our admin can deal with the deployment. there could also be an possiblity to get the integrated windows authentication running with waffle => so i will go with jetty
10:01zippy314never mind, found a nice answer here: http://mmcgrana.github.com/2011/09/clojurescript-nodejs.html
10:27choffsteinMorning all! Quick question -- is there an easy way to pull the doc-string from any function?
10:27choffsteinI thought (:doc (meta function)) would work -- but :doc doesn't seem to pull up the doc-string
10:27choffsteinideally, I'd like to get it back in string format -- not print it
10:27raekchoffstein: the docstring metadata is actually not stored on the function object, but on the var
10:28choffsteinraek: ah, well, that explains it :) Is it stored in the namespace?
10:28raek,(-> #'conj meta :doc)
10:28clojurebot"conj[oin]. Returns a new collection with the xs\n 'added'. (conj nil item) returns (item). The 'addition' may\n happen at different 'places' depending on the concrete type."
10:28choffsteinThhhatttt is probably what is going wrong then.
10:28raekwell, the var can be accessed from the namespace, from var-quote or from 'resolve'
10:30raekthere might not by any simple way to go from conj (the function) to #'conj (the var)
10:30choffsteinAwesome. Thanks :)
10:30raekbut from 'conj (the symbol, e.g. using a macro) to #'conj is possible with resolve
10:35choffsteinAppreciate the help, raek. Think I got it working
10:36raeknp :)
10:55kzarI'm changing the library I require in one of my files, I would like to use the same alias as before but now I get an error. Without kiling restarting the Java process is there a way to clear the alias so I can re-use it?
11:06neroothIs there any difference in syntax between a lazy seq and a list in clojure? They booth look like (a b c) as far as I can tell
11:08ambrosebsnerooth, they both print identically at the REPL
11:08manutternerooth: yes, there's a difference, but it's mostly invisible unless you get into the grit
11:09manutter(range) is a lazy seq of all numbers greater than zero
11:09manutterthere is no equivalent list that will fit inside your RAM
11:14neroothI see, thanks. I was sure I had a list at my hands but it turned out to be a lazy seq.
11:16manuttera common gotcha is that a lazy seq is essentially a generator that churns out list items incrementally, but the REPL gets the seq items eagerly, making a lazy seq look like a list
11:16neroothAh I see
11:16manutterbut in your actual code (not at the REPL), it goes back to behaving like a lazy seq, especially if you pass it to (apply str i-thought-this-was-a-list!)
11:17khaliGnerooth, why cant it be both?
11:17neroothboth?
11:17manutter(where i-thought-this-was-a-list! is the lazy seq, of course)
11:17khaliG(class '(10 20 30)) == (class (seq '(10 20 30))) == clojure.lang.PersistentList
11:18manutterright, but seq is not necessarily lazy seq
11:19manutter,(class (map identity [1 2 3]))
11:19clojurebotclojure.lang.LazySeq
11:19neroothnify bot
11:19neroothnifty*
11:37gfredericks$findfn {:a 2 :b 2 :c 3} {3 [:c] 2 [:a :b]}
11:37lazybot[]
11:39aaelonya curious question: There is map and pmap. Is there a reason why there is no pfilter for filter in parallel ?
11:40gfredericksaaelony: not sure, but it should be easy to implement
11:40raekkzar: try (ns-unalias 'your-ns 'the-alias)
11:41raekremove-ns can be handy too
11:41aaelonygfredericks: perhaps that's the reason then...
11:41gfredericks(->> coll (pmap #(list (p %) %)) (filter first) (map second))
11:42aaelonygfredericks: wow, that's cool
11:42gfredericksaaelony: haven't tried it, that was just off the top of my head :)
11:42aaelony:)
11:44aaelonygfredericks: interesting the that 2nd map is not a pmap.
11:44gfredericksaaelony: I assumed that p is the computationally intensive part, so the last two operations wouldn't be helped by parallelism
11:44gfredericksfirst and second are pretty efficient operations :)
11:45aaelonyright.
11:45gfredericksI'm not an expert on parallel algorithms, so I don't know if that's valid reasoning
11:46aaelonyThanks for your example. I'm thinking it over. :)
11:46gfredericksaaelony: no problem
11:47aaelony:)
11:47khaliGmanutter, yep good point :)
11:48aaelonywow. Hope nathan will make slides available on storm soon :)
11:50gfredericksmanutter: I'll just transcribe all the talks here on IRC so it'll be just like you're there
11:50TimMcyay
11:50manutter:D
11:50TimMcDo the voices, do the voices!
11:50gfredericks"So finally we add the last bolt in the topology, which gives us all the word counts..."
11:51TimMcCan you relay our questions back? :-P
11:51gfredericksof course
11:51manutterwhat if somebody @ strangeloop reads your transcription during a presentation, and begins relaying it to the audience?
11:51gfredericksthen I can use copy and paste
11:51TimMcThat would be silly, who would do that? :-)
11:52manutteror am I taking the name too literally?
11:52gfredericksso I hope that hapens
11:52manutter:D
11:52manutterstrangeloop -> feedbackloop
11:53TimMcgfredericks: That takes all the fun out of it. You should introduce typos.
11:53gfredericksif the person shouting out my transcription doesn't make errors I can still copy/paste
11:54gfredericksI guess the clojure folks at SL probably aren't on IRC
11:54gfrederickskhaliG: it'll be open source in a few minutes
11:54gfredericksactually right this minute I think
11:54manutterthat would be a pretty interesting twitter app, actually. Have retweets create random mutations in the text, see how the message evolves over time/propagation
11:54tomoj:D
11:54khaliGgfredericks, oh?
11:54gfrederickshe promised to open-source it right in the middle of the talk
11:55gfredericksand someone just interrupted to remind him
11:55manutterTimMc: ^_above_^
11:55gfredericksshould be at github.com/nathanmarz
11:55manutterstorm is what they're using on the twitter backend isn't it?
11:55gfredericks4 projects
11:55gfredericksstorm-deploy
11:55gfredericksmanutter: yeah
11:55gfredericksstorm-starter
11:56gfredericksstorm-kestrel
11:56gfredericks(all repos being made public now)
11:56gfredericksand storm
11:56tomojhurrah
11:57gfredericksTimMc: ha!
11:58gfrederickslooks like it's all in java? somebody quick write a clojure lib for it
11:59gfredericksclorm?
11:59mrBlissapparently storm still depends on clojure 1.2.0 instead of 1.2.1
11:59TimMcjtorm
11:59gfredericksmaybe storcl and pronounced "storkle"
11:59gfredericksoh is storm itself in clojure?
11:59gfredericksall his demos and sample code is in java
12:00TimMcgfredericks: https://github.com/nathanmarz/storm/graphs/languages
12:00TimMc20% Clojure
12:00hugodstorm-deploy uses pallet :)
12:00TimMcAnd 64% Java, so about even.
12:01gfredericksTimMc: wifi here not good enough to load that page apparently
12:01gfrederickseven though I can stay ssh'd into my server w/ irc
12:11edwCan someone tell me why I get an assertion exception in this case: (binding [*assert* false] ((fn [x] {:pre [(>= x 0)]} x) -1))
12:13TimMcedw: Here's a lead: http://stackoverflow.com/questions/4874517/how-to-make-clojure-respect-assert-variable
12:14edwTimMc: Thanks!
12:14TimMcYou apparently need to set! it.
12:15edwTimMc: That's what I expected, that *assert*'s value was significant and read- and compile-time, not execution time.
12:15TimMcI think it was something to do with fn's expansion.
12:15TimMc*has
12:16TimMcWell, maybe not. (After some experimentation.)
12:16devnAw, I'm not the first to mention Storm
12:17devngfredericks: I think you just need to disconnect and reconnect. A lot of people were going to watch/fork/clone when nathan released that.
12:19TimMcdevn: I think gfredericks is disconnected already.
12:26pauldooIs there an easy way to intern arbitary objects (a la String.intern())? I'd imagine some macro along the lines of memoize could create an interner..
12:31sridwhat is the best way to run command in clojure asynchronously? i.e., i don't want to block when reading lines from the process's stdout. (background -- the command I intend to run is "tail -f ..." via ssh)
12:32sridspecifically, i have a list of hosts on which I want to run "ssh $host tail -f /var/log/app" and get the log lines as a seq.
12:33sridthe commands should run in background, and i should be able to read the output (lines from tail) asynchronously
12:33sridi'm not a java programmer, so this stumps me.
12:38scottjsrid: maybe (pmap #(sh "ssh" % .. ) hosts)
12:40sriddoesn't `sh` block until the process is ended? (remember, `tail -f` never ends)
12:51eliOcshihi!!
12:55eliOcsis there anyone alive in this idle world?
12:55eliOcs:)
12:55Fossinope
12:55eliOcscrap
12:55eliOcswilling to talk?
12:55Fossiat least i do feel more like a zombie
12:55eliOcsme too working long hours with java legacy code makes me feel that way
12:56eliOcstrying to clean up my mind on my free mind with a little bit of clojure
12:56Fossii wish this was already "legacy" ;)
12:56eliOcshaha
12:56eliOcsdo you own a mac?
12:56Fossinope
12:56eliOcsok
12:57eliOcsI'm trying to setup emacs for clojure on my mac but I keep getting to outdated tutorials
12:57eliOcswhich don't work :(
12:57eliOcsI've always been a vim guy and getting to setup clojure for emacs is killing me
12:57eliOcsˆˆ
12:58eliOcsfossi which ide do you use for clojure?
12:59zerokarmalefteliOcs: the first method described at https://github.com/technomancy/swank-clojure works well
12:59zerokarmaleftit's much simpler with clojure-jack-in
13:00eliOcsokay I'm going to try it right now
13:01nickmbaileyfwiw, i've found vimclojure works fine for me. not ready to try the jump to emacs :)
13:04eliOcsI guess if a try to learn clojure I'll go all the way and try to learn emacs
13:05zackhameliOcs: i was a (am still a...) heavy vim user and just made the switch. basic keybindings don't take long to learn. pain lasted for 2 days at most
13:06Fossiemacs is simply tooooo nice for lisps
13:06Fossiesp with paredit
13:06Fossitakes a month to get up to full speed though
13:07zackhami jumped in for org-mode and coincidentally got interested in clojure at the same time, convenient i guess
13:08zackhamnow im using erc and notmuch and half the time open vim in a term buffer =(
13:08zackhamsucks you in
13:08TimMcHaving a physical (dead tree!) cheatsheet *really* helps. Write it as you go.
13:09zackhamyea the png cheatsheet for paredit is really good
13:10khaliGzackham, linky?
13:11zackhamhttp://www.emacswiki.org/emacs/PareditCheatsheet
13:11zackhamnever did find a pdf of it, just printed the png *shrug*
13:17Bronsahttps://github.com/nathanmarz/storm
13:17eliOcsthanks for the cheatsheet guys
13:20zackhameliOcs: no problem, here's a decent one for emacs in general: http://www.cs.colorado.edu/~main/cs1300/lab/refcard-emacs.pdf - prepare to be pretty disappointed at how small the "motion" section is =)
13:20sridhow do I find if the first of a lazy-seq is realized or not?
13:20srid(specifically a line-seq)
13:21eliOcszackham: omg all this material makes me feel like a real noob ˆˆ
13:27gfrederickssrid: why do you need to know?
13:28amalloy(inc gfredericks)
13:28lazybot⟹ 1
13:29sridgfredericks: the line-seq was run a 'tail -f' command. i do this for more than one 'tail -f' commands. since looping over a single line-seq could block (because a 'tail -f' command had othing to pring due to unmodified logfile), i want to first check if there is any data before doing the same to other line-seq's
13:29sridput simply, i want to 'tail -f' more than one log file in clojure without blocking. (then send them to redis)
13:29srid(and these logs live on remote machines; so I wrap the command with ssh)
13:30sridapparently clojure 1.3 introduced a `realized?` function to do just that. but this is not possible in 1.2?
13:31sridbut realized? probably doesn't help here. a line-seq must be realized anyway, and that could either block or not
13:33amalloyinstead of looping over the files and checking to see if data is available, why not give each of them a thread/future that reads them as fast as possible, doing whatever you want when data comes in
13:34amalloyeg, having an agent somewhere that re-syncs all those futures into one cohesive seq of lines
13:35sridhmm, then i'd have to read upon on concurrency features such as agent.
13:35sridi'm looking to do a quick prototype by today and worry about doing it properly later.
13:36manuttersrid: agent is pretty easy, just look it up on clojuredocs and that should be enough for a quick workable proto
13:38manutteractually, look agents in the clojuredocs quick reference section, send and send-off are probably really all you need.
13:38manutter(well, one of them anyway)
13:41nkozaAn example for JOC: (let [r (range 1 1e9)] [(last r) (first r)]) blows the heap, but let [r (range 1 1e9)] [(first r) (last r)]) not. I think in the second case r is being unbound before calling last as a compiler optimization. My question is, how is this optimization called? "automatic unbounding" or something like that?
13:41khaliGthat cheatsheet is excellent, i wish i'd tried paredit earlier
13:42sridmanutter: `send` on an agent is an async operation?
13:42manuttersrid: I think you want send-off for the non-blocking functionality
13:42sridthat's neat
13:42manutterI just reviewed the docs on clojuredocs myself and I'm not sure there isn't a typo there in the docs for send
13:43sridi suppose the thread is automatically killed upon function exit (in send)
13:43manutterThey'll time out, or you can call shutdown-agents explicitly if you know you just want to bail.
13:44sridi don't understand how send invokes `f`. in (send agent inc) it passes the agent' curent value to inc. but in (send agent slurp "file.txt"), it doesn't
13:45manutterright, the arg to f is the current state of the agent, if you want different args use (fn [_] (slurp "file.txt"))
13:45sridi was looking at the send-off example that caused the above confusion
13:46manutter(fn [_]) means (function that takes one argument and ignores it completely :)
13:46sridso that example is wrong?
13:46sridhttp://clojuredocs.org/clojure_core/clojure.core/send-off
13:46manutterHmm, I think it is, haven't tried it.
13:46amalloy&(doc slurp)
13:46lazybot⇒ "([f & opts]); Reads the file named by f using the encoding enc into a string and returns it."
13:47amalloyugh. what are the damn opts please
13:47manutteryou know what, though, I might be wrong
13:47amalloymanutter: it looks wrong to me, but might by coincidence work
13:48amalloyno
13:48manutterer, send-off I mean
13:48amalloyno
13:48amalloyonly functions are germane to the current discussion
13:49manutteryeah, no, just checked the source: send-off is a function, and the example at clojuredocs is correct
13:49amalloymanutter: what makes you say it's correct?
13:50manutteramalloy: The & opts refers to optional additional arguments to be passed to f as arguments #2 & following
13:51amalloyuh...
13:51amalloy(let [a (agent nil)] (send a slurp "http://google.com&quot;) (await a)) ;; fails
13:52clojurebot,(let [testar (fn [x y] (if (= (reduce + (filter odd? (range 0 x))) y) (str y " is an")) )] (testar 10 25))
13:52bhenrymanutter: he was doc-ing slurp not send-off
13:52manutteroh wait, you were looking at the opts for slurp not for send-off
13:52manutterlol, yeah, ok sry
13:52manuttertrying to multi-task here
13:52manuttergithub is timing out on me, quit trying to fork storm you guys
13:53amalloy(let [a (agent "UTF-8")] (send a slurp "http://google.com&quot;) (await a)) ;; might work, the first time, maybe, by coincidence
13:55amalloysrid: weren't you asking like...last wednesday whether you had to learn concurrency primitives in order to do concurrency stuff? and i think people said yes. it seems they've been proven right in that you're stuck here with no idea how to advance your program, but you're still saying you want to do it without learning how to use agentss
13:56TimMcnkoza: I don't know if r is being unbound -- what version of Clojure are you using?
13:57manutterI'm stuck, the definition of send-off is (.dispatch a (binding [*agent* a] (binding-conveyor-fn f)) args true)
13:57sridwanting to do it by today. i may use agents if that doesn't take too much of today's time to learn.
13:57manutterand I don't really know what .dispatch is doing
13:57amalloynkoza: "locals clearing"
13:57nkozaTimMc: 1.2
13:57manuttersrid: I'd play around with it, send-off is what you need, and if the example at clojuredocs doesn't work for you, try the version I suggested.
13:58TimMcOK. I waited for both to finish, and neither did.
13:58nkozaamalloy: thanks
13:58nkozaTimMc: check the memory comsumption of both
13:58TimMcYou mean before I kill them?
13:59amalloyanyway, short answer is that the slurp example is just wrong. it does send the agent's current value to slurp
13:59nkozakhaliG: where is the paredit cheatsheet?
13:59nkozaTimMc: yep
13:59khaliGnkoza, http://www.emacswiki.org/emacs/PareditCheatsheet
13:59manutternkoza: http://www.emacswiki.org/emacs/PareditCheatsheet
14:00manutterlol, I was racing you khaliG, but you beat me
14:00khaliGhaha :)
14:00nkozathanks guys
14:00sridinteresting. peek cannot be used on a seq?
14:01TimMc,(peek (seq '(2 3 4)))
14:01amalloy$google paredit cheat sheet
14:01clojurebot2
14:01lazybot[EmacsWiki: Paredit Cheatsheet] http://www.emacswiki.org/emacs/PareditCheatsheet
14:01amalloywould have been the fastest way, just fyi
14:01amalloyTimMc: that's cheating
14:01amalloy&(peek (seq [2 3 4]))
14:01lazybotjava.lang.ClassCastException: clojure.lang.PersistentVector$ChunkedSeq cannot be cast to clojure.lang.IPersistentStack
14:01TimMchee hee
14:02sridpeek on a lazy-zeq, I mean.
14:03sridanyway, it doesn't matter. `(send t (fn [[_ s]] [(first s) (rest s)]))` works to pull elements from a line-seq without blocking. i just do (first @t) to get the recent line.
14:05TimMcnkoza: first/last plateaus at 960 MiB, last/first at 330 MiB. Neither halts within a minute, and both reach that steady memory level.
14:06TimMcI suppose the latter is churning through quite a bit of garbage, but I don't see why the former continues to run at all.
14:06TimMcMaybe it is waiting for swap space.
14:06sridcd -
14:21chouserGeneral-purpose 4clojure solution: #(reify Object (equals [_ _] (= %&)))
14:22amalloy~guards
14:22clojurebotSEIZE HIM!
14:23sridcan agents be a collection of other agents?
14:24amalloychouser: i'm sure we have a few problems that aren't of the form (= (__ ...) ...)
14:24chouseramalloy: indeed you do
14:24amalloybut that's a clever cheat
14:24chouserthis is what comes of golfing
14:26amalloythe server counters by disallowing code submissions when username=chouser
14:27sridbtw, send itself returns immediately. so why does send-off exist?
14:27chouseramalloy: heh
14:31technomancysrid: different thread pool
14:32chouseramalloy: actually, that fails for many many of the problems. Any that have a collection on the right-hand side of =
14:33chouserfor those you need: #(reify clojure.lang.IPersistentCollection (equiv [_ _] (= %&)))
14:34amalloychouser: i like the use of (= %&) to imply you're doing actual equality tests
14:34chouserheh
14:34srid(send agt afunc) is followed by a loop that prints @agt. the print stops right when afunc returns. what could have happened?
14:35TimMcchouser: I see, it has to use %& to accept any number of arguments.
14:36amalloyright. he could optimize by using % for single-argument functions
14:39jolyevil... :P
14:40chousercareful with that always-true object. My REPL thinks it's equal to the EOF sentinel and quits.
14:40chousernot always true, I guess. "equal to everything"
14:41TimMcchouser: Ah, I was wondering what was going on.
14:41TimMcNasty.
14:43amalloychouser: that's fantastic
14:43TimMcIt doesn't kill the REPL, it just hangs it.
14:43chouserhuh, mine shuts down very cleanly.
14:44chouseraw, http://4clojure.com/problem/114 does the equality in the wrong order.
14:45TimMcA.k.a. the chouser-proof order.
14:45chouser:-P
14:48sridinvoking https://gist.github.com/1227251 blocks right after printing "Returning new agent value:" ... and I have no idea why!
14:49srideven when run in the context of no agents, i.e, direct invoke
14:49srid'curr' is a map of hostname to line-seq
14:50chousersrid: it bloack? it doesn't return nxt?
14:51chousers/bloack/blocks/
14:51lazybot<chouser> srid: it blocks? it doesn't return nxt?
14:51sridyes, when I do (update-running-deas) in repl it just hangs right after that println statement
14:51sridi had to kill swank and restart it
14:51Nocabwow
14:51NocabHN is so full of android-hate today, I might as well do some clojure :P
14:52sridchouser: ah, I see why. the values of the map are lazy-seq .. so the repl is trying to print them. but these lazy-seq's point 'tail -f' processes, so repl hangs.
14:52sridI guess.
14:53sridbut not sure why this happens in (send aAgent update-running-deas) too
14:53sridis `send` realizing the lazy-seqs (in map values)?
14:55sridmy guess was right. (keys (update-running-deas)) runs finitely in repl
15:07arohnerhas clojure.contrib.def made it into 1.3 contrib anywhere?
15:08Bronsaarohner: part of it should be into core.incubator
15:08arohnerBronsa: thanks
15:32neroothI have user={:type "tester", :name "hej", :_id "57c6d53e-daca-46b6-92ab-63c3b37de22e"} but (get user :type) returns nil. What am I doing wrong?
15:34arohnernerooth: user is a vector
15:34arohnerget looks up things in maps by their keys, but in vectors looks them up by index
15:34arohnerso you could do (def user {:type "tester" … })
15:34arohnerand that would work, or with your current version, (get user 0)
15:35arohnernerooth: I'm sorry, I misread that
15:35neroothHm, but aren't k:v related?
15:36zerokarmaleftlooks like a map to me, and it should return "tester"
15:36arohnernerooth: I misread the { as [
15:36opqdonut,(let [user {:type "tester", :name "hej", :_id "57c6d53e-daca-46b6-92ab-63c3b37de22e"}] (get user :type))
15:36clojurebot"tester"
15:36amalloynerooth: given that your user object is what you say it is, then your get statement will work. so, one of the two is not quite pasted accurately
15:36opqdonutyou are mistaken
15:36opqdonutuser is not a map like that :)
15:38xianraek: I'm back. The jar is not available on Jarvana :( I'm still not quite sure how to modify the CP for a leiningen project. Btw, the required jar is the tools.jar from the J2SE distribution.
15:38neroothhttp://pastie.org/2559373
15:39neroothThat's copy paste from code and my lein run window
15:40xianraek: I found this (http://binarysolo.posterous.com/using-roberthooke-to-alter-the-classpath-of-a) to modify leiningen's CP but accepting another dependency just for that seems a bit ugly.
15:41neroothAm I blind or does opqdonut and my paste look the same?
15:41ordnungswidrighi all, is there a guide for working with leiningen and multiple source directories? I typically have a main project and some libs which I work on at the same the.
15:42opqdonutnerooth: what's (.getClass user)?
15:42opqdonutit might be something weird
15:42amalloynerooth: drop the println
15:42amalloy&(println {:x "test"})
15:42lazybot⇒ {:x test} nil
15:43amalloy&(println {:x "\"test\""})
15:43lazybot⇒ {:x "test"} nil
15:43opqdonutright
15:43amalloyprintln makes it so easy to lose type information
15:43opqdonutprn is better
15:43amalloy&(println {":x" "test"})
15:43lazybot⇒ {:x test} nil
15:44amalloy&(println {:x 'test})
15:44lazybot⇒ {:x test} nil
15:44opqdonutindeed
15:44opqdonutI'm thinking user might be a string
15:44opqdonutsince you get those quotes
15:44opqdonutbut _always_ use prn when debug-printing things :)
15:45amalloyopqdonut: worse, user is a string *with quotes in it*
15:45neroothIt is indeed a string
15:46neroothwhat's the difference between prn and println information-wise?
15:48amalloyprn is designed to print data in such a way that, if you run the reader over the result of prn, you get back the same data
15:48amalloyprintln is designed to look reasonably nice when a human reads it
15:48TimMcprn is just pr + newline, yeah?
15:49amalloyyes
15:49lazybot⇒ "([]); Writes a newline to the output stream that is the current value of *out*"
15:49TimMcweird
15:50TimMcOk, so: ##(pr-str ['hello "hello" :hello])
15:50lazybot⇒ "[hello \"hello\" :hello]"
15:50TimMc&(read-string (pr-str ['hello "hello" :hello]))
15:50lazybot⇒ [hello "hello" :hello]
15:54neroothThanks for the help :)
15:57TimMcnerooth: Tip on read-string -- check out the *read-eval* var
15:58TimMcBind it to false if you are reading user-supplied forms.
16:00sridapparently setting an agent to a lazy-seq realizes it (thus hangs) :-(
16:00sridno.
16:01amalloyagents have no magic properties. they are just adjustable pointers to objects
16:01arohnertechnomancy: why does lein HEAD depend on contrib, when lein contains no contrib code?
16:02arohnerI can't start 1.3 projects w/ swank because of it
16:06neroothI will TimMic, thanks
16:06neroothTimMc*
16:06arohneris anyone else in AOT hell because of clojure 1.3 + contrib 1.2?
16:07srid(send realize-lazy-seq lazyseq) returns immediatley; how do I know when/if it has realized or not? it could use counters, but that is ugly.
16:09arohnersrid: you could use a promise
16:09arohner,(doc promise)
16:09clojurebot"([]); Alpha - subject to change. Returns a promise object that can be read with deref/@, and set, once only, with deliver. Calls to deref/@ prior to delivery will block, unless the variant of deref with timeout is used. All subsequent derefs will return the same delivered value without blocking. See also - realized?."
16:09arohner&(doc promise)
16:09lazybot⇒ "([]); Alpha - subject to change. Returns a promise object that can be read with deref/@, and set, once only, with deliver. Calls to deref/@ prior to delivery will block. All subsequent derefs will return the same delivered value without blocking."
16:09arohnersorry, lag
16:10amalloyi run my code by both bots anyway, just to be sure
16:10sridi don't know. value can be set only once? i intend to (first a-lazy-seq) multiple times and set the result on the agent.
16:10arohneramalloy: ha. I wasn
16:11arohnerI wasn't sure whether the bot was working
16:11sridi suppose i should just use threads.
16:11arohneramalloy: from my perspective, I saw nothing for 5+ seconds, so I tried the other bot
16:12sridor I can call (send) recursively from f.
16:13amalloyarohner: i know, you explained it. but i can't be expected to miss an opportunity
16:23TimMcchouser: I suppose the REPL wouldn't barf on that equals-everything object if it reversed its own argument order.
16:26sridnice, just using agents I can accumulate logs from multiple source into a single clojure list.
16:26sridno threads needed, yet.
16:29TimMcI'm too lazy to implement .equals properly. I'll just use this: (equals [me them] (if (nil? them) false (.equals them me)))
16:30TimMcSee, it even works within-type: ##(let [lazy-eq (reify Object (equals [me them] (if (nil? them) false (.equals them me))))] (= lazy-eq lazy-eq))
16:30lazybot⇒ true
16:31amalloy*blink* that seems like it shouldn't work. what's the trick?
16:31amalloyoh, = probably does a pointer-comparison before delegating to .equals?
16:32TimMcSeems so.
16:33srid,(doc seque)
16:33clojurebot"([s] [n-or-q s]); Creates a queued seq on another (presumably lazy) seq s. The queued seq will produce a concrete seq in the background, and can get up to n items ahead of the consumer. n-or-q can be an integer n buffer size, or an instance of java.util.concurrent BlockingQueue. Note that reading from a seque can block if the reader gets ahead of the producer."
16:33sridthis is probably what I needed before
16:33sridor not - "reading from a seque can block"?
16:34TimMcsrid: As opposed to returning nil?
16:34sridyea
16:34sridi am currently using agents to process the lazy-seq
16:35sridi involved some substantial code though.
16:41Nocabcant recall who asked me
16:42Nocabbut Ive been using clojure with eclipse for a while
16:42Nocaband now Im trying it out in emacs with swank/slime instead
16:42Nocab(and lein)
16:42Nocabso far the only thing I can say eclipse does better is the integration with the repl
16:42NocabI cant for the life of me figure out how to send my code from the file to the repl...
16:43Nocabam I supposed to copy it manually?
16:45TimMcThere's some command to send the current expression, and another for the whole buffer. (I think.)
16:45Nocabyeah that was sorta what I figured, just cant find it :P
16:45brehautC-x C-e ?
16:45Nocablet me try
16:45brehautNocab: http://dev.clojure.org/display/doc/Getting+Started+with+Emacs
16:46raekNocab: C-c C-k
16:46amalloy(inc raek)
16:46lazybot⟹ 10
16:47amalloyC-x C-e and/or C-M-x to evaluate the current form (where they differ is their definition of "current form")
16:47amalloyand C-c C-k to eval the whole file
16:48sridis it possible to atomically pop a agent queue? my code is likely not atomic - https://gist.github.com/1227572
16:50amalloyno. if you want to do something synchronous, don't use agents
16:52raeksrid: you cannot do multiple reads from an agent atomically.
16:52Nocabamalloy: Im trying to use C-x C-e to evaluate the current form. and I do get a tiny line at the bottom with the result
16:53amalloymission accomplished, that's what you're supposed to get
16:53Nocabamalloy: ie, (+ 1 2) yields a one-line "3" at the bottom.
16:53Nocabbut it doesnt intergrate with the bigger slime console/panel
16:53raeksrid: you could perhaps send it a "pop request" with a 'promise' and deref that promise
16:53Nocablike load my code in there, my functions, so I can fool around with them in the interactive console
16:53NocabI could do that in eclipse
16:53amalloyNocab: C-c C-k
16:54amalloyand if the code you had <C-x C-e>'d had been a defn, it would indeed have been available at the repl after that
16:54raekNocab: yeah, you don't see the result in the repl
16:54raekNocab: but you can do this: http://bc.tech.coop/blog/070424.html
16:54Nocabamalloy: aaah. my bad
16:54Nocabit did work, but the code and the REPL was operating in different namespaces
16:54raekah
16:55NocabI had to prefix my function namespaces and then it worked
16:55Nocabsilly emacs
16:55raekC-c M-p
16:55Nocabeclipse didnt cause that to happen ;)
16:55sridraek: i'll try that in a moment.
16:55raekto change namespace of the repl
16:55raeksrid: but maybe you should reconsider the concurrency primitive (atom/ref/agent) you are using
16:55amalloyeclipse probably just guessed what namespace to put you in at startup; if you'd started editing a different namespace i suspect you would have had similar problems
16:55hugodC-c C-c to compile the current top level form
16:56raekif you need to synchronize the state of the agent with your own thread, then agents are not ideal
16:56zerokarmaleftNocab: just change slime's active namespace with in-ns
16:56raeksince they are meant to be asynchronous
16:57zerokarmaleftoh, there's a keybinding for that, derp
16:57amalloyNocab: since it was probably unclear; raek's C-c M-p was aimed at you
16:57raekC-c M-p <ret> in the source file buffer has the same effect as in-ns
16:57zerokarmaleftnice, storing that away
16:57raekNocab: ^
16:57raek^^
17:04Nocabcool thanks
17:04Nocab(view (function-plot pdf-normal -3 3)) ;woo
17:06Nocabman this channel is like #linux back in the 90s
17:06Nocabuseful
17:06Nocaband alive too ;)
17:41sridraek: hmm, not sure how I can bake (promise) in https://gist.github.com/1227572 .. where exactly would you call deliver?
17:42sridcalling deliver from send's function still doesn't guarantee atomicity
17:42sridctx - the agent primitive was suggested to me as a quick hack before going on learning the clojure concurrency primitives
17:58CozeyHi. I'm using swank.cdt - i can break on a function, but can i insert a "debug repl" call compatible with swank.cdt somewhere in the code?
18:03sridraek: I fixed the pop issue by using *ref* to store the last popped item, and sleep till it no longer refers to (peek). but it terribly slowed down the log processing. i.e., (pop-log) is now taking much time to run (presumably spending time on Thread/sleep) https://gist.github.com/1227750
18:08NetpilgrimWhat would be the #(…) equivalent of (map (fn [x] [0 x]) [1 2 3])? With both #([0 %]) and #('[0 %]) the vector is called as a function.
18:08amalloy(juxt (constantly 0) identity) ;; lol?
18:09amalloy#(vector 0 %)
18:09brehautNetpilgrim: ##(read-string "#([0 %])")
18:09lazybot⇒ (fn* [p1__8482#] ([0 p1__8482#]))
18:10Netpilgrimamalloy: vector works. I'm mostly curious why the quoting doesn't have any effect.
18:11amalloyNetpilgrim: brehaut's answer to that is pretty definitive
18:11amalloy&'#([0 %]) ;; a shorter way to write it
18:11lazybot⇒ (fn* [p1__8483#] ([0 p1__8483#]))
18:11Netpilgrimamalloy: Neither of you quoted the vector.
18:12amalloybut ##'#('[0 %]) won't work any better
18:12lazybot⇒ (fn* [p1__8491#] ((quote [0 p1__8491#])))
18:12amalloy(all those hashes and quotes look funny)
18:13amalloythe point is that in a #(foo) form, foo is *always* called as a function, because it is *always* wrapped with parens
18:13amalloyyou can quote it; fine. then the quoted vector is called as a function
18:13Netpilgrimamalloy: But in the latter case it's the quote that's called as a function, isn't it?
18:14Netpilgrimamalloy: Hm, okay more parens than I thought. :)
18:14brehautpedantry: i dont think quote is a function
18:16NetpilgrimWell, I'll just remember that #(…) can only call a function while (fn …) can return a value.
18:16amalloyi wonder if "pedantry" is a registered nick
18:16brehauthah
18:40arohnerhas anyone built a contrib-1.2 that works with clojure 1.3?
18:46amalloythat seems unlikely to happen
18:51arohneramalloy: I'm in the middle of doing it myself
18:52arohnertoo many of my current deps don't work w/ 1.3, because they depend on contrib 1.2
19:37ibdknoxit appears clojurescript is about 3-4 orders of magnitude slower than native JS :(
19:38amalloyibdknox: 3-4 orders of magnitude, or just 3-4 times? i'd be surprised if it were ten thousand times slower
19:38ibdknoxorders of magnitude
19:38ibdknoxamalloy: loop over 1 million items
19:38ibdknoxjs: 1-4ms
19:39ibdknoxcljs: 3-4 seconds
19:39ibdknoxsimply iterating, not doing anything in the body of the loop
19:40ibdknoxthough to foil any special optimizations in the JS, I made it set a var to a value
19:40ibdknoxonly for the native JS code though
19:41ibdknoxthis came up while I was trying to implement the drawing of tiles for a canvas-based game
19:41ibdknoxiterating over 144 integers is very nearly too slow for the render loop
19:41amalloythere still could easily be special optimizations. try adding up the numbers from one to a million
19:42ibdknoxwith the addition it goes up to about 15ms
19:43ibdknoxlooping over 144 items shouldn't take 5-10ms
19:43ibdknoxlol
20:47Cozey##handler-case
20:47Cozey&'handler-case
20:47lazybot⇒ handler-case
20:47Cozey&'(handler-case :type (raise :type :foo :value 123) (handle :foo (println "error " (:value *condition*))))
20:47lazybot⇒ (handler-case :type (raise :type :foo :value 123) (handle :foo (println "error " (:value *condition*))))
20:48Cozeyi'm doing something wrong here :P
20:48Cozey&(handler-case :type (raise :type :foo :value 123) (handle :foo (println "error " (:value *condition*))))
20:48lazybotjava.lang.Exception: Unable to resolve symbol: handler-case in this context
20:49Cozeyuh oh. I'm using condition-1.3.0-alpha4 and I get 'cannot bind non-dynamic var: *condition*. *condition* is defined with defvar.. i'm not sure why i get this error.
20:53technomancyCozey: try slingshot instead: http://github.com/scgilardi/slingshot
20:54Cozeytechnomancy: but it's stencil package which is using condition - i just want to handle id properly
20:54Cozeyso i can't decide what to use :/
20:55technomancyhm; you'll need to file a bug with stencil then
20:59Cozeyyep i guess. i'll check if nothing pulled contrib 1.2..
20:59Cozeywhere is a website when i can track what revision should i put in my project.clj to be up to date with clojure 1.3?
20:59Cozeyi use -alpha4 - perhaps it's old already?
21:01amalloyCozey: -RC0
21:01amalloyor do you mean what version of stencil? i guess i should wait until i understand the question, before answering
21:01Cozeyamalloy: no.no - what version of clojure
21:02tomojwhere's RC0?
21:02Cozeyamalloy: hmm. perhaps i should follow github
21:03amalloytomoj: in clojure's repo, whever that is
21:03arohnersounds like I have another user for my contrib-1.3-compat
21:03tomojmaybe http://build.clojure.org/releases is the old one?
21:03tomojnewest 1.3.0 there is alpha4
21:04tomojbut isn't that where leiningen looks?
21:04arohnerCozey: following github is probably your best bet
21:04tomojoh, no
21:05Cozeyhow about contrib?
21:05amalloyhttp://build.clojure.org/job/clojure/lastStableBuild/
21:05Cozeythe clojure.contrib is nwo split to differnt packages. i can't really get my head around it - where's contrib.trace?
21:05Cozeytools.trace?
21:05clojureboteg, https://github.com/clojure/tools.logging is the new version of clojure.contrib.logging
21:05Cozeybut this is empty: https://github.com/clojure/tools.trace
21:05tomojstrange, I don't see that in lein's source
21:06tomojah http://repo1.maven.org/maven2/org/clojure/clojure/
21:07technomancyclojurebot: where did contrib go?
21:07clojurebotwell... it's a long story: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
21:11devnheh
21:14Cozeyand the versions for those new contrib project are not in sync with clojure versions. ie [org.clojure/data.zip "0.1.0"] ?
21:15amalloyno, having them be in sync with clojure versions would be madness
21:16amalloythen you couldn't update either without updating the other - huge headache
21:17Cozeyright, ok!
21:18andar_When I'm using swank-clojure in emacs, and update my dependencies in lein, is there a way to update the classpath in swank/slime without needing to restart emacs?
21:20carkhhello
21:20carkhanybody having trouble withg lein 1.6.1 and windows ?
21:21carkhthis kind of problem : Exception in thread "main" java.lang.NoClassDefFoundError: Files
21:21carkhon a simple : lein version
21:22carkhisn't the Files class a java 1.7 thing ?
21:25tomojmaybe it's in a plugin?
21:25Cozeywhat about clojure.contrib.prxml? it's not mentioned on the web site?
21:26Cozeyor repl-utils ?
21:27carkhtomoj: hum actually my poor google skills only kicked in now, the solution to my problem is downloading the master version of the bat file and replacing the version number
21:27amalloyCozey: data.xml
21:27amalloybut that still isn't released (chouser? looks like some kind of build failure, but i don't konw my way around hudson)
21:28Cozeyyep, data.xml is missing from maven repo
21:29amalloyhttp://build.clojure.org/job/data.xml/
21:30amalloylooks like indentation-settings test failed
21:42amalloyinteresting. tests pass for me
23:21icefoxWhen cljsc has a compiler error it spits out a java backtrace. Any way to turn that into something useful?
23:22amalloylook at it with your eyes? :P
23:23icefoxException in thread "main" java.lang.RuntimeException: java.lang.AssertionError: Assert failed: Can't recur here
23:23icefoxframe
23:23icefox at clojure.lang.Util.runtimeException(Util.java:153)
23:23amalloyit's the same message you get for compiler errors in clojure proper
23:23technomancyamalloy: I always look at stack traces with my heart.
23:23icefoxNot sure how that applies to my code
23:23mindbender1please how do I switch to swank buffer in emacs
23:24technomancyC-c C-z
23:24amalloyicefox: is that the only line in the entire stacktrace? if so, i agree that's pretty useless
23:24icefoxamalloy: no there are a few hundred
23:24amalloywell then
23:25icefoxIt looks like an internal bug in the compiler?
23:25mindbender1technomancy: it says undefined
23:26amalloyno. it looks like you doing (loop [x 1] (inc (recur x)))
23:27icefoxyah I did add a loop, hmm guess this is one of those things to learn clojure you have to learn what errors happen to actually mean in your code
23:27icefoxlike g++ templates or whatnot :)
23:29amalloyicefox: just look through the the stacktrace for *.cljs files - i bet one of them is yours
23:30st3fanhmm question about sql/with-query-results .. how do i simply get a non lazy list of results back?
23:30amalloy&(doc doall)?
23:30lazybot⇒ "([coll] [n coll]); When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce the first element in the seq do not occur until the seq is consumed. doall can be used to force any effects. Walks through the ... https://gist.github.com/1228253
23:31st3fanah i was looking at doseq
23:31st3fanlet me try
23:31st3fanyes awesome
23:31icefoxamalloy: nope my test.cljs file is not mentioned in the backtrace, it is inside clojure.lang.Compiler.eval
23:34mindbender1please how do I switch to swank buffer in emacs
23:34mindbender1my swank server is freezing on clojure-jack-in
23:35jaomindbender1, C-x b *swank*
23:36mindbender1It says "Couldn't find project.clj, which is needed for jack-in" how do I resolve this
23:37technomancymindbender1: M-x clojure-jack-in must be run from somewhere inside a project directory
23:37technomancyif you want a standalone swank server you can do ~/.lein/bin/swank-clojure in the shell and do M-x slime-connect
23:38mindbender1I did but deep inside a the project directory I believe it should still be able to run
23:39technomancyyeah, that should be fine. can you run "lein swank" from the shell deep inside the project?
23:40mindbender1ok, errors exist
23:40mindbender1WARNING: spit already refers to: #'clojure.core/spit in namespace: examples.utils, being replaced by: #'clojure.contrib.duck-streams/spit
23:41mindbender1Exception in thread "main" java.lang.ExceptionInInitializerError
23:41mindbender1 at clojure.main.<clinit>(main.java:20)
23:41mindbender1any idea what to do?
23:41technomancyyou're getting that from swank?
23:42technomancymaybe gist project.clj?
23:42mindbender1yes and I also tried from root of project it gives similar errors
23:42choffsteinHey all. Question: is there a way to eval something in a temporary namespace so that any requires or uses don't propogate and pollute the current namespace? e.g. can I do (eval `(use 'clojure.contrib.duck-streams)) and basically not have it pollute the namespace with the symbols from duck-streams?
23:43mindbender1technomancy: gist project.clj?
23:43technomancychoffstein: slamhound does that
23:43amalloytechnomancy: really?
23:43amalloythat seems outside the scope of what slamhound was for last time i looked (which was ages ago)
23:43technomancychoffstein: essentially: (binding [*ns* (create-ns `sand.box)] (eval [...]))
23:44choffsteintechnomancy: Alright. I'll just go digging through your code :)
23:44technomancyamalloy: no, it's absolutely central that it's able to attempt compilation inside a throwaway ns
23:44technomancymindbender1: http://gisthub.com
23:45amalloyoh, i thought you meant he could use slamhound as a library to do this in his own code
23:45mindbender1technomancy I see another line that says "Could not find the main class: clojure.main. Program will exit."
23:45mindbender1Is there a way to check for conflicts
23:45technomancychoffstein: of course if all you're trying to do is load the code without bringing in all the vars of the namespace, you should just require instead of use
23:45choffsteintechnomancy: https://github.com/newfoundresearch/clj-doc-test/blob/master/src/clj_doc_test/core.clj
23:46choffsteinTrying to replace the (use '[~name-space]) with something that won't pollute. I found clj-sandbox as an option, but was hoping there was something else
23:46technomancythis is only good if you need to run code that depends on the vars refered by use
23:46technomancysounds like that would probably be the case hree
23:46technomancyhere
23:47technomancyso... who wants to tie in http://travis-ci.org/ results into clojars?
23:47clojurebotcontributing to clojars is a great idea! see http://groups.google.com/group/clojars-maintainers/browse_thread/thread/d4149ec96316d5b1
23:47technomancyclojurebot: thanks for volunteering!
23:47clojurebotthanks for your suggestion, but as usual it is irrelevant
23:48technomancydammit
23:48choffsteintechnomancy: can I reuse the same sandbox ns name?
23:48mindbender1technomancy: here git://gist.github.com/1228282.git
23:48technomancychoffstein: I recommend calling remove-ns in a finally, in which case it would be fine
23:48choffsteinah, I like that.
23:49technomancyit's line 33 of slam/hound/regrow.clj if you want to look at my approach
23:49technomancymindbender1: looks like a really old version of clojure-contrib is on the classpath
23:49technomancycan you also include project.clj
23:49technomancy?
23:49mindbender1ok
23:50choffsteintechnomancy: very cool. I hope you don't mind if I steal it :)
23:51mindbender1technomancy: https://gist.github.com/1228282
23:52technomancymindbender1: that's not right
23:52technomancythe stack trace includes code from contrib
23:52mindbender1you mean?
23:53mindbender1I should include clojure-contrib in dep
23:53technomancymindbender1: that stack trace should only be possible if clojure-contrib is in your dependencies in project.clj
23:54technomancyI guess it's technically possible there's an offender in ~/.lein/plugins; what's in that directory?
23:54mindbender1I ran lein swank from the dir where project.clj is
23:54mindbender1a min
23:55mindbender1only swank-clojure-1.3.2.jar
23:55technomancythere must be something more going on here
23:55mindbender1ok maybe it's version problem
23:55technomancywhat you're describing is not possible
23:56mindbender1seriuosly that's what I| did