#clojure logs

2011-06-29

00:00technomancy"no, you show _me_ the relevant ruling where it was determined that recursive copyright declaration was declared invalid in court."
00:01technomancyI mostly kid though. I love debian as a user. just not as a developer.
00:02cemericktechnomancy: tell that to the poor guys that apt-get install eclipse, and are left with a steaming pile. :-X
00:03amalloycemerick: that worked fine for me, last time i tried
00:03technomancyamalloy: "This file and all subdirectories it contains are copyright [...]"
00:03technomancycemerick: the JVM stuff seems particularly neglected
00:03amalloyah. i was thinking: "This file is governed by the copyright declarations that govern it"
00:03technomancyprobably due to java being non-dfsg-compliant for so long
00:04technomancyamalloy: heh
00:04cemerickamalloy: three separate people in the past two weeks got bizarre errors upon attempting to add ccw into pristine eclipse installs; downloading binaries from eclipse.org fixed all three
00:04technomancyreminds me of the cliki disclaimer
00:04technomancy"CLiki pages can be edited by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively"
00:05cemerickI have a sneaking suspicion that it has something to do with EPL v. GPL compatibility of certain usually-default eclipse plugin repositories that ccw depends upon.
00:05technomancyall the debian packaging docs are makefile this, autoconf that; figuring out how to package anything that's not C-based takes a lot of digging
00:05amalloycemerick: well, eclipse on unix has been a pain for me in general, because if you install as root you need to add plugins as root
00:06amalloyso if there was added pain from using a .deb i didn't notice
00:07technomancythey screw up rubygems pretty badly too in order to make it fhs compliant
00:07technomancypart of the reason I rejected the idea of writing the lein launcher in ruby
00:07cemerickamalloy: I think there's a way to cause it to use ~/.eclipse or something as the plugin/feature root
00:08technomancyheh; I added that exact feature to rubygems.
00:08cemerickIn any case, it's just not something that should ever be packaged the way it is. It's not designed for it, and seems to be done without input from the sources
00:08cemericks/sources/author(s)
00:08sexpbot<cemerick> In any case, it's just not something that should ever be packaged the way it is. It's not designed for it, and seems to be done without input from the author(s)
00:11tmciverHi all. What's the best way to debug Clojure code? Is there a way to step through a library my project uses?
00:13amalloytmciver: not that it's really an answer to your question, but shouldn't you be stepping through your own code? the library is likely to (a) work, (b) be harder to debug
00:14dnolentmciver: http://georgejahad.com/clojure/swank-cdt.html, https://github.com/hugoduncan/swank-clj
00:15technomancycdt is the only stepping debugger I know of
00:15hugodswank-clj does stepping too
00:15technomancycool
00:15cemerickas does enclojure
00:15dnolentechnomancy: jswat works as well as far as I know.
00:16tmciveramalloy, ideally, yes, but I think there's a bug. Of course it could be a bug in my code. :(
00:17tmciverIs stepping through the code not a *typical* debugging method?
00:17amalloyyeah, stepping is a lot less useful in a functional language. there are no "instructions"
00:17hugodit's nice to be able investigate exceptions at the throw site - even if the majority of locals are cleared
00:18tmciverI've tried putting print statements, :/, in the library and regenerating the jar, but I'm not seeing anything.
00:19tmciverI'll look into swank-clj
00:20hugodyou can add print statements and just recompile the file in slime with C-c C-k - no need to rebuild the jar
00:21amalloyhugod: even someone else's jar? i guess i never tried that
00:21hugodyep
00:21tmciverHmm. I just got slime/swank up and running. I'll have to check that out.
00:23tmciverhugod, how does that work? The file needs to be on the classpath?
00:24hugodUse M-. on one of the jar's symbols to navigate to the source in the jar file, edit, compile
00:24hugodor just open the jar file directly in emacs
00:26tmciverOpen a jar in emacs? Didn't know you could do that.
00:28tmciverIf I open the jar file, I get a listing of the class files. If I open one of those, it a binary (bytecode) file with some text . . .
00:29hugodI assumed you had .clj files in the jar…
00:30hugodyou can compile any file with C-c C-k, and it should work, whether it is on the class path or not, as long as all the :requires are on the classpath.
00:34tmciverIs it typical to have .clj files in the jar?
00:35hugodit is generally a good idea not to AOT compile clojure files unless you have a good reason to
00:35tmciverAh, I DO see clj files!
00:36tmciverI assume that if clojure code is not AOT compiled then the jar cannot be used from java?
00:38amalloytmciver: the java code just has to go through the clojure runtime to use clj files
00:38hugodI think that depends on how you are using it from java - if you are using any interfaces or classes gen-classed in clojure, you need them to be AOT compiled
00:38tmciverAh, OK. Thanks.
00:40tmciverOn that topic: I read that all clojure functions compile to their own class files. Can they be AOT compiled and then called from java?
00:42amalloyyes, but ew
00:42tmciverHa. I'm sure, but I'm just curious.
00:42dnolentmciver: you'll probably want to go through Clojure's RT.java.
00:42amalloy&(class ((fn [] (fn []))))
00:42sexpbot⟹ sandbox7608$eval11441$fn__11442$fn__11443
00:43amalloytmciver: that classname will change every time you compile
00:43tmciverOh! Yikes, that IS gross!
00:44amalloy&(class ((fn [] (fn [])))) ; again, for emphasis
00:44sexpbot⟹ sandbox7608$eval11452$fn__11453$fn__11454
00:45tmciverBy the way, I'm new to clojure on irc. how do I learn to use sexpbot and clojurebot?
00:45RaynesTo evaluate code with sexpbot, just prefix any message with & and everything after it will be evaluated.
00:45amalloytmciver: mostly by watching other people use them, really
00:45RaynesYou can also ##(println "embed code") in your messages.
00:45sexpbot⟹ embed code nil
00:46RaynesWith clojurebot, prefix messages with a , (comma) to evaluate everything after it.
00:46amalloy,(symbol "reporting for duty")
00:46clojurebotreporting for duty
00:46tmciverCool, thanks.
00:46amalloytmciver: sexpbot and clojurebot are both open-source, of course, if you want to look further into what features they have
00:47Rayneshttp://github.com/cognitivedissonance/sexpbot http://github.com/hiredman/clojurebot
00:47tmciverclojurebot is clojure-specific and sexpbot is not?
00:47RaynesThey both have mostly the same functionality.
00:48Raynessexpbot might have a bit more.
00:48RaynesIt can do Haskell evaluation and such as well.
00:48amalloyand clojurebot acts more human :)
00:48tmciverHmm. Do people prefer one over the other?
00:48Raynes$he [1..4]
00:48sexpbot⟹ [1,2,3,4]
00:48amalloytmciver: well, raynes and i prefer sexpbot. we're the main developers for it
00:48RaynesNot really. People just use whatever they feel like.
00:48amalloybut use what makes you happy
00:49tmciverGreat! Thanks for helping out a newb!
00:49amalloyoh, you can also /msg either of them if you just want to try stuff out but don't havea repl handy
00:49RaynesAll sexpbot really does different from clojurebot as far as Clojure evaluation goes is the embedded evaluation.
00:49amalloy(and don't want to spam #clojure with your nonsense)
00:50tmciverHa! I never write nonsense. ;)
00:52amalloythere's a subtle difference that clojurebot sends one message per newline, which can lead to unintentional spamming if you call println. but, it also makes it easier to tell where a newline is, since sexpbot just collapses all whitespace to single spaces
00:53Raynesamalloy: Would it be better to replace the spaces with fake newlines?
02:02sunnibohi guys.
02:03symboleHi.
03:45clgvHow do I consume something like a stream in clojure? In principle I have to do multiple calls on something like a read-method of the stream but have to check for EOF in-between to avoid having an EOFException thrown. In which control-structure do I put this? I only came up with loop-recur which doesnt seem to fit well since the stream is mutable.
03:49schasiHej hej
03:50schasiI am searching for a presentable successful example where clojure has been used with a lot of data, presumably in the cloud :)
03:50schasiWhat would you present there?
03:50Fossihow much is "a lot"?
03:51schasiExample would be statistical data sets
03:52schasi"a lot" being as much that it pays to put the whole thing on a cloud :D
03:53raekhttp://dev.clojure.org/display/community/Clojure+Success+Stories
03:54Fossiraek: seriously, most of those read like advertisements for the companies/products
03:55clgvhumm the last body of the clojure.core/read definition looks quite strange to me
03:55Fossiactually i can spot only one that answers the question on top: description of how you've used Clojure
03:56schasiFossi: Which one would that be? :D
03:56raekclgv: how are you consuming the stream? what do you want to do with it?
03:57Fossiokay, it's more like three
03:57clgvraek: I want to return a list of all statements that are in the stream, not only the first
03:57clgvs/statements/forms/
03:57sexpbot<clgv> raek: I want to return a list of all forms that are in the stream, not only the first
03:57Fossibut out of ~30 that's pathetic
03:57raekline-seq inside a with-open is one common way to read lines
03:58bsteuberschasi: http://www.infoq.com/articles/flightcaster-clojure-rails
03:58Fossi"our" entry is shitty as well
03:59clgvraek: there is not a line-end in the stream necessarily
03:59schasithank you, Fossi and bsteuber
03:59midsschasi: backtype.com also uses clojure and seems to handle shitloads of data
04:00clgvhow can this work? it seems to be a recursive definition: (defn read ([stream eof-error? eof-value recursive?]   (. clojure.lang.LispReader (read stream (boolean eof-error?) eof-value recursive?))))
04:02raek(def eof (Object.)) (defn form-seq [rdr] (lazy-seq (let [form (read rdr false eof)] (when-not (= form eof) (cons form (form-seq rdr)))))~)
04:02raekclgv: the last "read" is the name of a java method
04:03raek(with-open [rdr (io/reader "file.clj")] (process-the-data (form-seq rdr)))
04:03clgvraek: oh, thats the ". form" - I am not used to it, since I use the abbreviated style
04:04clgv&(doc form-seq)
04:04sexpbotjava.lang.Exception: Unable to resolve var: form-seq in this context
04:04clgv&(find-doc "form-seq")
04:04sexpbot⟹ nil
04:04raekso, form-seq can be defined as above
04:04raekmy previous line starting with (def eof (Object.))
04:05clgvah well. I see
04:05clgvthx, raek. :)
04:05clgvguess, I'll make that eof-object local;)
04:06raekjust make sure the resulting lazy-seq from form-seq does not escape the with-open scope
04:06clgvraek: thats probably a reason for not making it lazy ;)
04:06raekyou could replace "process-the-data" with "doall" or "vec" to force the seq
04:08clgvhumm one could also close the reader at the end of the seq - which would force the user to consume the whole seq finally.
04:08raekbut then it will only be closed if the whole seq is traversed
04:09raeka client might only look at, say, the first three forms or something
04:09clgvdo I get an EOF on a closed reader?
04:10raekor if the processing is aborted with an exception, the file will remain open too
04:10raekclgv: no, I think you get a illegal state error
04:10clgvraek: IOException it is
04:10raekif you try to read from a closed stream
04:11clgvI could build a macro that provides the form-seq where the reader is only opened within the macro-block like in with-open
04:11clgvand the sequence is only evaluated until EOF or stream closed
04:12raekalso, there's this: http://dev.clojure.org/display/design/Resource+Scopes
04:14clgvraek: it's just a discussion, no implemented concept, right?
04:14raekno implementation in any stable release
04:15raekbut some issues that one might need to look out for is mentioned
04:15clgvI think I can live with my macro solution: it has no resource problems but the lazy-seq of the reader will only contain the elements that were evaluated in the scope of the macro
04:21clgvhumm there seems to be no exception-less method to query if a reader is still open
04:23amalloyclgv: in what way is this different from with-open, then
04:24clgvamalloy: it's a combination of with-open and raek's form-seq
04:25amalloyright. i don't think you want to "hide" the details of opening and closing the reader within your implementation of form-seq, especially since you can't do so transparently. the client has to be aware of how long the stream is open, so let him manage it himself with with0open
04:26amalloyproviding both transparency and flexibility, as well as fitting in well with line-seq and friends, which don't open or close anything
04:27clgvamalloy: I was aiming at a "process-form-seq" macro
04:29amalloymeh. make it a function: (with-open [in (reader whatever)] (process-form-seq in #(println %))) ;; process-form-seq constructs a seq of forms from a reader, and maps the provided function over them
04:32clgvhumm right. I don't need to defer any evaluation - so a function will do
04:33amalloyclgv: i actually don't like my suggestion to use map: what if the client wants to reduce instead? then, of course, you generalize by just calling their function with the whole seq of forms as an arg
04:33amalloybut at that point you're not doing anything but (with-open [...] (some-function (form-seq rdr)))
04:33clgvyep
04:37amalloyanyway, bedtime for me. have fun reading forms
04:38clgv:D
04:58clgvit works. I just wrapped a try catch for IOException into raek's form-seq
08:25peteriserinshow to do (a b c) -> ([1 a] [2 b] [3 c])
08:25clgv&(map-indexed vec '(a b c))
08:25sexpbotjava.lang.IllegalArgumentException: Wrong number of args (2) passed to: core$vec
08:25clgv&(map-indexed vector '(a b c))
08:25sexpbot⟹ ([0 a] [1 b] [2 c])
08:26peteriserinsthank you
08:26clgvpeteriserins: do you really want to start with 1?
08:28peteriserinsclgv: nope, 0 is better
08:29clgv:)
08:53clgv$findfn vector '(a b c) '([0 a] [1 b] [2 c])
08:53sexpbot[clojure.core/keep-indexed clojure.core/map-indexed]
08:53clgv$findfn '(a b c) '([0 a] [1 b] [2 c])
08:53sexpbot[]
08:53clgv(doc keep-indexed)
08:53clojurebot"([f coll]); Returns a lazy sequence of the non-nil results of (f index item). Note, this means false return values will be included. f must be free of side-effects."
09:00peteriserinsI am having problems with re-seq
09:01peteriserinsit duplicates the last line of the input
09:01peteriserinsin a match
09:05clgve.g.?
09:06peteriserinsa\nb -> a\nb\n b
09:09clgvcan you please write your clojure statement and it's output? or write it here with preceding , or &
09:09peteriserinstried to upgrade my cake, but that became buggy now
09:10peteriserinsbasically just running "cake" throws an error about not finding "make"
09:10clgvI refered to the re-seq issue
09:10peteriserinsException in thread "main" java.lang.Exception: Unable to resolve symbol: make in this context (deps.clj:24)
09:10peteriserinsclgv: sorry, I cannot address that now atm, because I cannot run clojure code :)
09:11clgvI don't use cake.
09:11peteriserinsclgv: I normally use lein, but I hate that I have to create a project to play around with it
09:11peteriserinsclgv: so I used cake for that
09:11peteriserinsclgv: is there perhaps a way to run single-file programs with lein?
09:12clgvhm no idea. "create a project" in lein just means write a minimal project.clj or even let lein write it and just fill in the blanks.
09:13raekpeteriserins: you can run "lein repl" outside a project to get a bare Clojure repl. then you can use load-file, I guess
09:13clgvyou could just startup a repl yourself and load the single file...
09:13peteriserinslein repl < load-file "%" ?
09:14peteriserinsor (load-file "%")?
09:14raekI was thinking about typing (load-file "the_file.clj") in the repl...
09:15peteriserinsraek: yeah sure, I just want to type it from Vim if possible
09:15raekI dunno a convenient way to run scripts, since start only one clojure instance per development session
09:15clgvI like the "clj script" build with rlwrap.
09:17clgvsetup is described here: http://en.wikibooks.org/wiki/Clojure_Programming/Getting_Started#Enhancing_Clojure_REPL_with_rlwrap
09:17peteriserinsok I can use the lein repl meanwhile
09:17peteriserinsso the issue is
09:17peteriserinsI'm re-seqing with
09:17peteriserins#"(.+\n)+\n"
09:18peteriserinson "a\nb\nc\n\n"
09:18peteriserinsand it gives me ["a\n\b\nc\n\n c\n"]
09:20fliebelpeteriserins: try #"(.+?\n)+\n"
09:21fliebelhm, wait, maybe not. What do you expect to see?
09:21Fossi"...now you have two problems"
09:22peteriserinsfliebel: I get the same result
09:22clgv&(re-seq #"(.+\n)+\n" "a\nb\nc\n\n")
09:22sexpbot⟹ (["a\nb\nc\n\n" "c\n"])
09:22peteriserinsclgv: I get it, ty, I forgot clojure doesn't use ',' for separation
09:23peteriserinscan I make it greedy somehow?
09:23fliebelAnyone knows what non-reference grouping looks like in java regex?
09:24fliebel&(re-seq #"(?:.+\n)+\n" "a\nb\nc\n\n")
09:24sexpbot⟹ ("a\nb\nc\n\n")
09:24clgvpeteriserins: the greedy behavior is discussed in javadocs.
09:25fliebelpeteriserins: Isn't it greedy by default?
09:27clgvhttp://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
09:27raekpeteriserins: the vecctor you get is the vector of the groups for _one_ match
09:27clgvGreedy, Reluctant and Possessive are distinguished
09:28raek,(re-seq #"a(x|y)b" "axbaybaxb")
09:28clojurebot(["axb" "x"] ["ayb" "y"] ["axb" "x"])
09:28fliebel&(re-seq #"(?:.+\n)+\n" "a\nb\nc\n\na\nd\ng\n\n")
09:28sexpbot⟹ ("a\nb\nc\n\n" "a\nd\ng\n\n")
09:28raekif you have n groups in the regex, you get a vector of size n+1 with their matches
09:29raekwhere index 0 is the whole expression
09:29raeks/expression/matched substring/
09:29sexpbot<raek> where index 0 is the whole matched substring
09:31peteriserinsraek: riight
09:31peteriserinsraek: that's helpful
09:38raek...and as fliebel demonstrated, if you don't have any capturing groups, the string with the whole match is not wrapped in a vector
09:57VT_entity"Loop requires an even number of forms in binding vector" Why is this?
09:57VT_entitywhy can't I loop one s-expression over and over?
09:58fliebel&(loop [a])
09:58sexpbotjava.lang.IllegalArgumentException: loop requires an even number of forms in binding vector
09:58raekVT_entity: the forms in the binding vector are variable-value paris
09:58fliebel&(loop [a 1] a)
09:58sexpbot⟹ 1
09:58raek*pairs
09:59VT_entitywhat if I just want to loop one expression over and over?
09:59clgvVT_entity: explain by example
09:59raekVT_entity: even when you looop over one thing, you need to give it a name: (loop [x 10] (if (zero? x) 0 (recur (dec x))))
10:00fliebelHow do I get the latest 1.3.0 alphas/snapshots? I think it was something like [clojure "1.3.0-master-alpha7"]
10:00VT_entity(loop [cond (<= 0 (count examplelist)) (do (println "still greater than or equal to zero"))])
10:00raekVT_entity: ah, now I get what you mean by "one expression". like this: (loop [] (do-foo ..) (recur))
10:00VT_entityoh
10:01raekVT_entity: loop marks the point where you can jump back to. recur is the jump
10:01VT_entityI was looping the wrong thing?
10:01VT_entityooooooh
10:01fliebelraek: Would you prefer loop over while?
10:01raekthe vector is the loop variables
10:01raekfliebel: not in this case, I guess :)
10:02raekfliebel: remove the "-master" part
10:02VT_entityso, if I put the recur at the end, it should be ok?
10:02raek"1.3.0-alpha8"
10:02clgvit is (loop [BINDINGS] ...) not (loop [CONDITION] ...)
10:02raekor "1.3.0-beta1"
10:02fliebelraek: Hm, are we beta already?
10:02raekVT_entity: you are probably thinking of 'while'
10:03VT_entityI should d something like (while () do)
10:03clgvfliebel: yeah beta came out sometime in the last two weeks
10:03raeksaw a "[ANN] Clojure 1.3 Beta 1" in the mail recently
10:03fliebelclgv: You have the announcement handy?
10:03clgvfliebel: nope. I just saw it on clojure.org in the downloads section
10:04VT_entityoh dammit, wow, I just looked up while, you're right
10:04edwtechnomancy: I'm getting a port-already-in use error using clojure-jack-in. I thought port numbs were dynamically selected.
10:04raek(while <cond> <body>) is equivalent to (loop [] (when <cond> <body> (recur))) I think
10:04fliebelah http://groups.google.com/group/clojure/browse_thread/thread/bfad91ece6d1b983#
10:04clgvraek++
10:06fliebelWhat does 'approved backlog' mean in Jira?
10:06VT_entitythanks a lot raek
10:07clgv$inc raek
10:07sexpbot⟹ 9
10:13fliebelI wonder what's wrong with this: [org.apache.james/james-server "3.0-M2"] any ideas?
10:15cemerickfliebel: doesn't look like there's a jar artifact for those coordinates: http://search.maven.org/#artifactdetails|org.apache.james|james-server|3.0-M2|pom
10:15cemerickJust a super POM, it seems…
10:15fliebelcemerick: http://repo1.maven.org/maven2/org/apache/james/james-server/3.0-M2/james-server-3.0-M2.pom
10:16cemerickfliebel: right, that's a POM, not a jar. [foo/bar "version"] coordinates describe jar dependencies.
10:17cemerickI think there's a way to specify different dependency types in the lein world, but I don't know them off the top of my head.
10:17fliebelcemerick: Uhm, okay, and the other option is just to get all the right jars manually?
10:18cemerickfliebel: there looks to be a metric ton of apache james artifacts; presumably you need one (or more) of those?
10:19fliebelcemerick: Yea, I guess. I just want to run a mail server with SMTP and POP and then write my own database backend and do weird stuff.
10:19fliebels/POP/IMAP/
10:19sexpbot<fliebel> cemerick: Yea, I guess. I just want to run a mail server with SMTP and IMAP and then write my own database backend and do weird stuff.
10:21clgvfliebel: sounds pretty interesting.
10:23cemerickfliebel: Seems reasonable; you'll have to figure out which artifacts you need, though. Perhaps a msg to the james ML, or perhaps there's some docs somewhere that describe what each component does.
10:23fliebelclgv: Think https://github.com/pepijndevos/twemail without implementing the mail server.
10:25fliebelMaybe I shouldn't even try embedding and customizing a server, and just bang away on the maildir.
10:25TallAdam(apply please-help '(me))
10:27clgvhumm james server itself sounds interesting. I had lots of trouble when trying to setup a mail server with the single debian packages...
10:28TallAdamI am writing an open source library and I need to make it testable. I have made my tests but the tests need twitter credentials (as well some other credentials) to run. I need for the user to setup (def )'s just once, so that the tests can work - not sure the best way to do this? anyone got any ideas?
10:28clgvTallAdam: can you do some mocking?
10:29edwtechnomancy: ut?
10:29fliebelTallAdam: I ran all my Twitter test on a local statusnet instance :D
10:29TallAdamclgv: not sure what you mean?
10:30cemerickTallAdam: Using system properties for stuff like that is generally reasonable.
10:30TallAdamcemerick: thanks - thats a decent plan
10:31TallAdamcemerick: but if its not defined, how do I 'abort' the testing process?
10:31cemerickTallAdam: if you throw an exception at the top level, that will cause the loading of the test sources to fail, and tests will never be run.
10:32TallAdamcemerick: great - thanks for the advice
10:32cemericke.g. (def username (or (System/getProperty "foo") (throw (Exception. "no username!"))))
10:32cemerickI assume lein has a way to specify system properties for a given test run…
10:34jweiss_anyone here use clojure.contrib.trace? deftrace says it can be used in place of defn, but it can't - it won't take a docstring
10:35jweiss_also the fn it produces will have different metadata than the original - i'd like to keep the docs the same - same docstring and arg list
10:42jcromartiehey guys is quoting ever referred to as "code proection"?
10:42jcromartiehttp://blackstag.com/blog.posting?id=9
10:42jcromartieI've never heard that term for quoting before
10:45raekneither have I
10:51edwtechnomancy: I just sent you a pull request on clojure-mode: it fixes a misfeature I was banging my head against for 45 minutes.
10:56coopernursehow do you remove a elpa package installed locally?
10:56coopernurseI appear to have two versions of clojure-mode
10:56coopernurse1.9.1 and 1.9.2
10:59jcromartiecoopernurse: check your ~/.emacs.d
10:59coopernursejcromartie: can I just rm -rf the old version in elpa dir?
11:00jcromartieI believe so
11:00coopernurseok thanks
11:01jcromartieI think elpa just loads from those directories automatically, looking for a certain .el file
11:01coopernurseok
11:02coopernurseis it recommended to _not_ install the slime, slime-clj, slime-repl packages?
11:02coopernurseI'm gettting this error now when I run: clojure-jack-in
11:02coopernurse"Debugger entered--Lisp error: (void-variable slime-clj)
11:04hugodslime-clj is specific to swank-clj, and should not be installed if you are only using swank-clojure
11:04coopernursehugod: ok thanks. I removed it from the elpa dir, restarted emacs, and that error went away
11:12jcromartieThis tutorial (blackstag) made it to the top of HN, but it has a lot of iffy parts
11:13jcromartieI'd be wary of any intro to Clojure/FP that starts out with 0-ary functions returning random elements or calculations on def'ed vars
11:16clgvjcromartie: the term you cited above was probably the authors own invention as well ;)
11:16jcromartieyeah
11:17Fremjcromartie: There's probably free karma to be had here by posting corrections or recommending better tutorials. :-)
11:17jcromartieI mean, good on him for trying. I'm posting them as I read it.
11:27edwI wish people would stop talking about fight club. Can we try a little harder to keep our secret weapon secret?
11:32jcromartieedw: by "fight club" do you mean Clojure?
11:33S11001001is the behavior of (let [x (transient [])] (conj x x) (persistent! x)) defined?
11:34ejacksonedw: lol.
11:35ejacksonyes, if the other software consultants find out about this, i'll be outta business, chopitty-chop.
11:36solussd,(let [x (transient [])] (conj x x) (persistent! x))
11:36clojurebotjava.lang.ClassCastException: clojure.lang.PersistentVector$TransientVector cannot be cast to clojure.lang.IPersistentCollection
11:43clgvS11001001: looks pretty strange
11:44S11001001clgv: aye
11:45S11001001sorry
11:45S11001001obviously with just plain conj it's defined :]
11:45S11001001,(let [x (transient [])] (conj! x x) (persistent! x))
11:45clojurebot[#<TransientVector clojure.lang.PersistentVector$TransientVector@d66725>]
11:45S11001001,(let [x (transient [1 2 3])] (conj! x x) (persistent! x))
11:45clojurebot[1 2 3 #<TransientVector clojure.lang.PersistentVector$TransientVector@11a9e33>]
11:46S11001001alright then, that's fair
11:46clgvS11001001: be carefull - you have to use transient similar to normal immutable collections, i.e. you have continue your work with the result of (conj! x e)
11:47S11001001clgv: which was my position
11:47S11001001we've been having a debate on the subject of what it means, setting aside what it does
11:47clgvotherwise that might go wrong when you add a decent number of elements
11:47S11001001though I for one am glad that it doesn't let you build structures that at once appear to be functional and are circular
11:51dnolenthere's clearly a desire for more structured "beginner" Clojure material...
11:52jcromartieyeah
11:53jcromartieI like that these tuts start from the beginning
11:53jcromartiehow about one written in Clojure, which compiles to HTML
11:53jcromartiethat would just be a nice touch
12:04jcromartieand this tut starts with doseq, for, loop/recur... them moves on to map, reduce, filter, etc.
12:05technomancyedw: what is the problem specifically? basing it on a modulo of the current time seems equivalent to a random number
12:06technomancyis it that your patch is limited to a higher range?
12:10technomancyunless of course the random number generator hasn't been seeded?
12:15technomancyanyway if I were to change the port number heuristic I would make it deterministic based on the path of the project
12:51bsteuberstrange, on Mac OS I get a "Could not initialize class midje.sweet__init" when requiring midje, while on Linux the code ran just fine
12:52technomancyI blame the case-insensitive filesystem.
12:52technomancynot because it makes sense, just because I hate it.
12:52bsteuber:)
12:54bsteuberit seems that only happens through checkouts
12:57bsteubermaybe because in one project it was in dependencies and in the other in dev-dependencies
12:57bsteuberanyways, works now :)
13:10faust45hi guy's
13:12faust45can anyone recommend cool book or article about Functional Programming?
13:12faust45to wrap my mind around
13:14technomancyclojurebot: google out of the tarpit
13:14clojurebotFirst, out of 44600 results is:
13:14clojurebotOut of the Tar Pit
13:14clojurebothttp://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.93.8928&amp;rep=rep1&amp;type=pdf
13:14technomancymy favourite FP article
13:19faust45technomancy: thanks will read it
13:20technomancyit's not terribly technical but provides great background
13:20faust45just reading book onLisp
13:21technomancythat's not really an FP book, is it?
13:22faust45technomancy: have a chapter "Functional Programming"
13:22faust45technomancy: author try explain FP way to write
13:23coopernursetechnomancy: Out of the Tar Pit looks very interesting. thanks for the link
13:24faust45technomancy: but Out of the Tar Pit looks Theoretical, far from practice
13:25dnolenfaust45: I recommend the SML books on Hickey's Amazon reading list, the most approachable and comprehensive I've çome across on FP programming.
13:26faust45dnolen: SML?
13:26dnolenfaust45: Out of Tar Pit could use some more context, but it's based on practice not theory.
13:26dnolenfaust45: Standard ML
13:26technomancydnolen: dang it man, you made me poke at my screen to try to get that little speck off it
13:26derp__I'm sorry, I asked this q yesterday but my machine shutoff for some reason, so I couldn't read any answers
13:26derp__here is my compiling/broken code: https://gist.github.com/1052284
13:26dnolentechnomancy: heh oops.
13:26derp__and the error I get: https://gist.github.com/1052292
13:27derp__I think I'm doing everything right for calling a file, but I'm just not sure
13:27faust45dnolen: "Hickey's Amazon reading list" can you point me?
13:28dnolenfaust45: http://www.amazon.com/Clojure-Bookshelf/lm/R3LG3ZBZS4GCTH
13:28dnolenpretty much everything I've picked up off it is killer.
13:29faust45dnolen: pretty cool thanks!
13:30dnolenmost practical, the only thing I've seen that's too mathematical for my tastes if Foundations of Databases
13:30dnolens/if/is
13:30sexpbot<dnolen> most practical, the only thing I've seen that's too mathematical for my tastes is Foundations of Databases
13:45derp__okay, I really don't get this, I am trying to use swank+slime, and it works somewhat. M-. works for core/contrib clojure functions, but for some reason isn't working for looking up functions local to the project
13:46derp__this isn't working for either my project or https://github.com/technomancy/mire, so I don't think it's just my poor code
13:46derp__poorly written*
13:47hiredmanderp__: for M-. to work you have to compile the file first
13:49edwtechnomancy: ut?
13:50technomancyedw: sure
13:51edwtechnomancy: The problem with RANDOM is that it's pseudo-random and Emacs intentionally starts the generator with the same seed for every run, which means the clojure-jack-in while always attempt to connect to the same port of you open up a new emacs and invoke the command. Thus I was constantly getting port-in-use exceptions.
13:51edws/while/will/
13:51sexpbot<edw> technomancy: The problem with RANDOM is that it's pseudo-random and Emacs intentionally starts the generator with the same seed for every run, which means the clojure-jack-in will always attempt to connect to the same port of you open up a new emacs and invoke the command. Thus I was constantly getting port-in-use exceptions.
13:52technomancyedw: I see... I've seeded the random number generator in my dotfiles for so many years now that never occured to me
13:52edwtechnomancy: I didn't want to seed RANDOM because a user might not want it seeded.
13:52technomancywhat do you think about making it deterministic based on the project path?
13:53derp__hiredman: so I have to run lein compile then run lein swank?
13:53derp__I thought slime/swank was interactive
13:53edwThat's a toughie. I think that might work, as I think I want to know if I am already swanked into a project.
13:54technomancyedw: eh; actually I'm not too attached to that, and the current-time implementation has been written
13:54technomancyso I'll take it
13:54technomancythanks
13:54edwOK. I've run into this before, but I always just tried again after giving a wtf?!-shrug.
13:54edwAnd it would work...
13:54hiredmanderp__: you have to load the file C-c C-k
13:55technomancymerge'd
13:55edwCool. Thank you.
13:56hiredmanderp__: loading clojure code is compiling it, what `lein compile` does is aot compilation
13:57dnolenrpglover64: I'm curious as to why you want to avoid using gen-class ? deftype just isn't designed to do what you want. gen-class is about interop, deftype is not.
13:57rpglover64But it seems like it's just one footstep away!
13:58dnolenrpglover64: but I don't see deftype getting changed to support what you want.
13:58hiredmanrpglover64: what are you doing?
13:58rpglover64http://stackoverflow.com/questions/6515162/add-constructor-to-deftype-created-class
13:59hiredmanuse a factory
13:59hiredmaneither a clojure fn as a factor or (deftype SomeTypeFactory [] (create-some-type [] ...))
13:59hiredmanfactory
13:59derp__hiredman: thank you, that's working wonderfully. just out of curiosity, what's the 'apropos' command, so if I wanted to read about the doc/functionality of "C-c C-k"
14:00hiredmanM-x describe-key maybe?
14:01rpglover64clojure fn as a factory won't work; the java code calling me will expect a java class with a nullary constructor
14:01edwjcromartie: Yes, clojure.
14:01derp__hiredman: thanks!
14:02hiredmanrpglover64: this is for use with a library? what do you need fields for?
14:03rpglover64I'm using an intro to programming assignment to learn clojure
14:04rpglover64the assignment provides code for the graphical part that will call the code for the logic (that the student is supposed to write)
14:04rpglover64the way it does so is hacky
14:04rpglover64it expects to be passed a class (representing a game)
14:04hiredmanso if it is a stupid exercise, don't do it
14:04rpglover64and will call its 0-ary constructor
14:05rpglover64it's not a stupid exercise
14:05edwrpglover64: This sounds a bit like the C++ source I took as a freshman back in '91, where the instructor was learning C++ along with us. A complete nightmare.
14:05edwC++ course, that is.
14:06hiredmanrpglover64: you just said it is `hacky`
14:06rpglover64edw: the instructor knows java quite well; and software engineering concepts; the issue is that his students don't, so he tried to make the interface as easy as possible
14:06dnolenrpglover64: deftype doesn't expose any user defined constructors much less a nullary one. if you used gen-class you'd be done already ;)
14:06rpglover64hiredman: (not= "hacky" "stupid")
14:07hiredmanrpglover64: if an exercise makes you do things badly it is not a good exercise
14:07rpglover64dnolen: yes, but I won't have learned something very interesting
14:07edwrpglover64: Right, and my intructor knew C quite well. But you're in a Clojure course, not a Java course, right?
14:07rpglover64edw: i'm not in a course
14:07bsod1how can I stop vimclojure repl when it's in an infinite loop
14:07derp__I am still getting the same error about a function not existing
14:07derp__despite clean compilation using C-c C-k and lein uberjar
14:07clojurebotlein is http://github.com/technomancy/leiningen
14:08edwOK, then I'm completely confused.
14:08hiredmanderp__: what same error?
14:08jcromartieanybody watched "The Last Language" from NDC by Uncle Bob?
14:08rpglover64hiredman: I don't expect that if I do use clojure for anything in the corporate world that the java code I work with avoids such stupid hacks
14:08derp__error: https://gist.github.com/1052292 code: https://gist.github.com/1052284
14:09derp__so that's two files in the code gist, but I put it in one to be simpler
14:09derp__they are both in the same src dir
14:09hiredmanrpglover64: right, and if you really want to, you an use gen-class
14:09hiredmanrpglover64: or even use ASM directly to generate the code you want
14:09rpglover64hiredman: ASM = assembly?
14:10bendlashttp://asm.ow2.org/
14:10hiredmanrpglover64: deftype/reify/defrecord display better taste
14:10hiredmanasm is the bytecode generation library clojure uses
14:11dnolenrpglover64: rationale for not supporting user defined constructors in deftype is well covered here, http://jcip.net/
14:11rpglover64edw: my friend is teaching an intro programming (in java) course; the final assignment for the course is to implement the logic for a game, and he provided the pretty graphics code.
14:11rpglover64dnolen: oooh
14:11dnolenrpglover64: sadly the text of the book isn't at that location.
14:11hiredmanderp__: first off, using '_' in a namespace name is asking for trouble
14:12dnolenrpglover64: but a good chunk of Clojure's design philosophy lies therein.
14:12hiredmanuse '-' in the namespace name and '_' in the file/directory name
14:12dnolenrpglover64: great book and certainly worth having a physical copy, regardless of what language you actually program in.
14:13derp__hiredman: wait, what? so if you are create a file with multiple words in the title, how do you name it?
14:13rpglover64dnolen: I'll look into it
14:13derp__are you saying I should refer to my code as stupid-func within clojure, and name the file stupid_func_ns.clj?
14:13hiredman'-' is more lispy but '-' is not valid as part of a classname, field name, etc, so it gets mapped to '_', and to make clojure files correspond closely to the class files they would generate '_' is also used in place of '-'
14:14dnolenrpglover64: Concepts Techniques Models of Computer Programming cites it as the goto book for concurrent programming in imperative languages.
14:14bendlashiredman: does windows have a problem with - in file names?
14:14hiredmanbendlas: no idea, I suggest #windows
14:15bendlaswhat else would be the reason for the convention of using _ in files?
14:15derp__hiredman: so that seems pretty complicated, so you just use '-' and let clojure map it to underscores when needed? seems like camel caps would be easier at this point
14:15hiredmanbendlas: I just gave the reason above
14:15bsod1how can I cast a list to a vector
14:15hiredmanderp__: how is it not simple?
14:16amalloybsod1: step 1, don't use the word cast for something that's not a cast. it will confuse you and everyone around you
14:16amalloy&(vec '(a b c)) ;; step 2
14:16sexpbot⟹ [a b c]
14:17bsod1amalloy: thanks. and sorry for `cast` :)
14:17bsod1amalloy: so what's the proper word for it?
14:17amalloy(step three, really try to avoid doing it. if you need a vector, build it to begin with)
14:17hiredman"is there a function that takes a list and returns a vector?"
14:18bendlasbite my shiny metal ass
14:19hiredmanamalloy: he must be talking to you
14:19bendlasI managed to do a whole mid-sized clojure project while staying convinced that 'src/foo-mod.clj' would be found by (require 'foo-mod) too ...
14:19bendlaslol
14:20bendlasthanks for clearing that up, hiredman
14:20hiredman~namespaces
14:20clojurebotnamespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it
14:20choffsteinHey all. I keep running across a pattern where I need to map the values of a hash -- both with, and without knowing the key. I've pretty much just been using reduce, wrapped around an assoc, to reconstruct the hash. I found map-values in clojure.contrib.datalog.util, which I think solves my problem, but seems like it is in a pretty obscure place. Is there anything closer in the core library that solves my need?
14:20derp__hiredman: I still don't understand what you are saying. Can you just show a quick example, e.g. filename "hello_dir.clj" and then refer to it within clojure as "hello-dir.clj"?
14:20hiredmanderp__: file names ahve '_' namespace names have '-'
14:20hiredmanhave
14:21jcromartiechoffstein: it should be easy to write your own
14:21choffsteinjcromartie: I have written my own ... I was just wondering if there was already a pre-built solution :)
14:22bendlaschoffstein: do you mean ,(map inc (vals {:first 31 :second 63 :third 127}))
14:22jcromartieit's a one-liner AFAIK
14:22bendlas,(map inc (vals {:first 31 :second 63 :third 127}))
14:22clojurebot(32 64 128)
14:23raekderp__: when you eval (require 'aaa.bbb-ccc) Clojure will look for "aaa/bbb_ccc.clj" on the classpath
14:23jcromartie,(into {} (map (fn [[k v]] [k (inc v)]) {:first 31 :second 63 :third 127}))
14:23clojurebot{:first 32, :second 64, :third 128}
14:23choffsteinah, interesting.
14:24choffsteinthat is much cleaner than what I am doing :)
14:24jcromartiethere are a million ways to do it :)
14:24bendlasor
14:24bendlas,(let [m {:first 31 :second 63 :third 127}]
14:24bendlas (zipmap (keys m)
14:24clojurebotEOF while reading
14:24bendlas (map inc (vals m))))
14:25bendlasdmn
14:25bendlas(let [m {:first 31 :second 63 :third 127}] (zipmap (keys m) (map inc (vals m))))
14:25derp__last question: when I create a project, is the accepted nomenclature "my-project" or my_project"?
14:25bendlas,(let [m {:first 31 :second 63 :third 127}] (zipmap (keys m) (map inc (vals m))))
14:25clojurebot{:third 128, :second 64, :first 32}
14:25bendlassry for spam
14:25jcromartieBAN HIM
14:25jcromartieyeah I like the zipmap version
14:26bendlasclojurebot: Y U NO UNDERSTAND MULTI LINE INPUT?
14:26clojurebottrampoline is the clenched fist in the gauntlet of letfn
14:26choffstein....
14:26choffsteinwell played, clojurebot
14:26choffsteinyeah ... zipmap is very sexy there
14:27jcromartieit shouldn't matter, but zipmap does mess up the order of keys
14:27Scriptorclojurebot has a markov chain builder?
14:28choffsteinare you guaranteed that the order of (keys m) and (vals m) are the same? i.e. the first element in (keys m) is guaranteed to associate with the first element of (vals m)?
14:28bsod1is there a way to stop vimclojure REPL when it's stuck in an infinite loop
14:28bendlaschoffstein: yes
14:28choffsteinsweeet
14:28bendlashashmaps have a canonical traversing order
14:28jcromartiechoffstein: it shouldn't matter
14:29choffsteinjcromartie: it would if you are doing the zipmap way, right?
14:29jcromartieboth varieties return PersistentArrayMap
14:30bendlasyes, it would matter
14:30choffsteinnot sure I follow why that makes it not matter...
14:31jcromartieI mean that when printing the resulting map, the keys are in different order
14:31jcromartiethe hash-map is correct
14:31jcromartiebut it prints differently that's all
14:31choffsteinoh, okay
14:33jweiss_is there a predicate that can differentiate between a function and a macro?
14:33jweiss_ifn? and fn? say true for both
14:34technomancyjweiss_: should be :macro metadata on the var
14:34jweiss_technomancy: coll thx
14:34jweiss_cool
14:34technomancynp
14:35hiredmanand macros must be held by a var
14:36jweiss_hiredman: yeah these are all vars. i'm using a trace lib (hjlee's) and it keeps trying to trace macros and replacing them with vars that don't work.
14:37jweiss_it's using fn? so i'll 'and' in that metadata check
14:37edwAnyone here use redis with aleph? When a persistent connection has to re-connect, you lose authentication. I'm wondering how people deal with that.
14:38hiredmanjweiss_: interesting, I wonder why they don't work
14:41jweiss_hiredman: i don't know, but when i call macroexpand-1 on my macro *after* i enable tracing on it, it doesn't expand. just returns what I passed to macroexpand.
14:41jweiss_disabling tracing doesn't fix it either.
14:42hiredmanjweiss_: sounds like the trace is removing the :macro metadata
14:42hiredmanok
14:42hiredmanmy guess is usage of (with-meta …) instead of (vary-meta …)
14:42hiredman*drumroll*
14:43jweiss_hiredman: perhaps you can spot the problem: http://clojure.googlegroups.com/web/trace_fn.clj
14:43hiredmanI recommend using the trace from contrib
14:44bendlasjweiss_: you said fn? says true for a macro?
14:45hiredmanyeah, the implementation of enable-trace is disgusting
14:45hiredmando not use
14:45bendlaslike in
14:45bendlas,(fn? #'let)
14:45clojurebotfalse
14:45bendlas?
14:45jweiss_hiredman, the trace from contrib is not a replacement for defn like it says.
14:45hiredman(type #'let)
14:45hiredman,(type #'let)
14:45clojurebotclojure.lang.Var
14:45jweiss_,(fn? (deref #'let))
14:45clojurebottrue
14:45hiredmannot a fn
14:46bendlasyou can deref a macro var w/o having the compiler scream?
14:46jweiss_hiredman: contrib's deftrace doesn't allow docstrings
14:46bendlasthat's new
14:46bendlas(to me)
14:46jweiss_or anything defn does that fn doesn't
14:47hiredmanjweiss_: https://gist.github.com/1054566
14:48hiredmanbut the implementation is icky, using a seperate map of traced fns is dumb
14:48hiredmanshould just use var metadata
14:48jcromartie,@#'for
14:48clojurebot#<core$for clojure.core$for@7f3159>
14:49hiredman^- assumes key is a namespace qualified symbol, I didn't check
14:49jweiss_hiredman: ok, i think i'm better off fixing up this lib because i don't have to alter my existing code. with contrib.trace I do, pretty severely
14:49jcromartie,for
14:49clojurebotjava.lang.Exception: Can't take value of a macro: #'clojure.core/for
14:49amalloybendlas: the var just holds a function; the metadata on the var is what tells the compiler to treat it as a macro. so if you explicitly deref the var, then what you get back is a plain old function
14:50jweiss_hiredman: var metadata to hold the original fn?
14:50dnolenSTM for PyPy ?
14:50dnolenhttp://morepypy.blogspot.com/2011/06/global-interpreter-lock-or-how-to-kill.html
14:50hiredmanjweiss_: yes, I would checkout robert.hooke
14:50hiredman~hooke
14:50clojurebotTitim gan éirí ort.
14:50amalloy&(#'and true false)
14:50sexpbot⟹ true
14:50hiredmanclojurebot: jark
14:50clojurebotjark is a clojure daemon for scripting: http://icylisper.in/jark/
14:50bendlasamalloy: got it. That's kinda cool
14:50hiredmanbleh
14:50hiredman~robert hooke
14:50clojurebotexcusez-moi
14:51hiredman~google robert.hooke clojure
14:51clojurebotFirst, out of 60 results is:
14:51clojurebotHelp with Debian packaging - leiningen | Google Groups
14:51clojurebothttp://groups.google.com/group/leiningen/browse_thread/thread/45dc4c878cd24fc8
14:51hiredmanugh
14:51amalloyhiredman: foiled again
14:51hiredmanhttps://github.com/technomancy/robert-hooke
14:52hiredmanclojureot: hooke is <reply> https://github.com/technomancy/robert-hooke
14:52jweiss_hiredman: ah, i've heard that lib mentioned before, never knew what it was. now i'll get a chance to try it. thanks
14:53hiredmanclojurebot: hooke is <reply> https://github.com/technomancy/robert-hooke
14:53clojurebot'Sea, mhuise.
14:53bendlasyes, I have been noticing that google doesn't rate gh-pages of clojure libs very well
14:53dnolenthough it's not clear to me how they'll make it as efficient as Clojure's STM w/o refs and fast persistent datatypes ...
14:54hiredmandnolen: yes, and the comments are *sigh* inducing
14:55hiredman"What happens when transaction interleaves together and fail? "
15:11coopernursethere seems a certain irony in debugging a Java deadlock whilst reading the Out of the Tarpit PDF in another window
15:15JohnnyLcoopernurse: Funny, I know a nurse whose last name is Cooper. :)
15:19coopernurseheh.. tis not m
15:19coopernurseme
15:38jcromartiecoopernurse: hah awesome
15:38jcromartiecoopernurse: I've wondered about implementing OotT's recommendations
15:38jcromartieI think everybody that has read it wonders the same thing
15:38jcromartiehow do you actually do it... where does the rubber meet the road?
15:38jcromartieespecially when it comes to persistence with existing RDBMS
15:38coopernurseyes, as is probably evident by my dumb questions here, I'm new to FP
15:39jcromartiedo you let the storage be "dumb" or what?
15:39coopernursebut I find the promises seductive
15:39jcromartieabsolutely
15:39jcromartiethere's also the more OOP-oriented Domain Driven Design school of thought
15:39jcromartieit's close to FRP
15:39jcromartieexcept wrapped up in objects
15:40coopernurseinteresting.. I've looked at DDD
15:40coopernurseit looked like a lot of indirection
15:40coopernurseI haven't gotten to the punchline yet in OotT
15:40coopernurseso I don't know all their suggestions yet
15:41jcromartieI think some DDD concepts map to FRP. DDD invariants -> FRP logic layer; DDD Entities and Commands -> FRP essential state
15:41amalloyit sounds like you guys are more into Acronym-Driven Design
15:42jcromartiebah
15:42coopernursewell, I'm open to any approach that will help me understand the system I'm building and keep the cost of change low
15:50S11001001data display debugger?
16:24jweiss_technomancy: remove-hook in robert.hook doesn't seem to work for me the way it seems to in the unit test. i still see the hook in the meta, but with-hooks-disabled says there are no hooks
16:29fliebelWhat is the name of that Clojure graph database and query dsl?
16:29fliebel(two different things I think)
16:30midsjiraph?
16:31fliebelmids: I guess...
16:32midsalso neo4j is pretty cool and has clojure bindings
16:32fliebelmids: 5 of them even ;)
16:32midsheh
16:32amalloyfliebel: query dsl is plasma, i think you mean
16:34fliebelamalloy: Bingo!
16:35technomancyjweiss_: could be; remove-hook hasn't ever been used outside the test suite to my knowledge
16:46jweiss_technomancy: i'm not sure how it works anywhere, the :robert.hooke/hook atom contains a cons. calling (remove #{f} ...) on it doesn't seem to have any effect
16:49hiredmanjweiss_: there are issues with function identity
16:49amalloy&(= first (with-meta {:x 1} first))
16:49sexpbotjava.lang.ClassCastException: clojure.core$first cannot be cast to clojure.lang.IPersistentMap
16:49jweiss_hiredman: yeah, i see that. = returns true, but remove doesn't work
16:49amalloy&(= first (with-meta first {:x 1}))
16:49sexpbot⟹ false
16:49bsod1can anyone help me? when I run (source println) I get this exception: #<CompilerException java.lang.Exception: Unable to resolve symbol: source in this context (REPL:28)>
16:50amalloy(use '[clojure.repl :only [source]])
16:50amalloyjweiss_: i'm not sure i buy that. if = returns true, remove will work
16:50amalloywell. (remove (partial = f) ...) will work, anyway. (remove #{f} ...) can in certain cases have problems, but i don't think this is one of them
16:53hiredmanbsod1: https://github.com/clojure/clojure/blob/master/src/clj/clojure/main.clj#L258
16:54hiredmancode in the repl will behave differently from code run outside of the repl
16:54bsod1hiredman: great, thanks
16:55jweiss_amalloy: hm... well it doesn't work. not sure why
16:55hiredman,(= (fn []) (fn []))
16:55clojurebotfalse
16:56hiredman^- the issue, if you have recompiled since the hook was added you will be unable to remove the hook
16:59derp__okay I am so stuck on figuring out how to create a basic project with a main calling functions from another namespace.
16:59derp__here's my umpteenth try: https://gist.github.com/1054944
17:03S11001001jweiss_: I think top-level vars are merely updated
17:04jweiss_S11001001: not sure what you mean
17:04hiredmanS11001001: there are no other kinds of var
17:04S11001001hiredman: ah, right :)
17:06S11001001jweiss_: assuming the hook is defined in a var, you could pass in the var instead of the function
17:21hugodderp__: you need to use gen-class and aot compile sample-proj.start for that to work, I believe
17:23hugodyou might have more luck with lein run if you just want to run something outside of a repl
17:25derp__hugod: wow, it works with lein run! But why is that, and what do I have
17:25derp__what exactly do you mean by gen-class and aot compile?
17:27derp__has gen-class changed much recently, or can I use a blog post from a year ago or so to figure it out?
17:29hugodderp__: http://clojure.org/compilation
17:30AWizzArdProtocol dispatching: most concrete wins?
17:31AWizzArdmost concrete type
17:31dnolenAWizzArd: no
17:31AWizzArdk
17:31dnolenthere's no way to know which will win.
17:32AWizzArdCan I somehow specify then: for types A, B, C and D use this implementation i1, and for class E take i2?
17:32dnolenand in fact it will probably change between JVMs or even JVM runs.
17:32hugodderp__: and :aot in https://github.com/technomancy/leiningen/blob/master/sample.project.clj
17:32AWizzArdCurrently I only implemented the supertype of a, b, c and d
17:32dnolenAWizzArd: you cannot prefer as you can with multimethod.
17:33mrfaisonhi folks! a very basic tutorial for clojure for a java programmer?
17:33AWizzArdYes okay I see, so I will better list explicitly a, b, c and d instead of just implementing it for their superclass.
17:33dnolenAWizzArd: yup.
17:33AWizzArdSo, when I then (foo e-instance) it can not take those.
17:33AWizzArdNow my question is: if the implementation for a-d is identical, can I then specify this nicely?
17:33AWizzArdOr will I have to copy/paste the body 3x?
17:34AWizzArdextend-protocol looks good, only that it expects a type and then the concrete implementation.
17:34dnolenAWizzArd: copy/paste or macros. fn maps are currently possible but it sounds like they may go away to allow protocols to sit at the foundation.
17:35AWizzArdOkay, be it copy/paste for now. Thanks.
17:35fliebeldnolen: As I understood it, only generated maps will go away, in favor of literal maps, so you can still share fn definitions.
17:36technomancyis there an easy way to block till all running threads finish?
17:36derp__hugod: thank you so much! your suggestions really helped
17:36dnolenfliebel: ah I didn't catch that.
17:37pjstadigtechnomancy: doesn't that automatically happen for non-daemon threads when you fall off the end of the main method?
17:37AWizzArdWhat surprised me: I have the type X which has the subtypes A-E. I extended X with implementation i1 and then explicitly E with i2. But it seems it still chose i1 for my call with an E instance.
17:43technomancypjstadig: yeah. I want to do it earlier
17:43technomancyhttp://p.hagelb.org/shutdown-agents.jpg
17:44technomancyjoegallo: ^^
17:44pjstadigtechnomancy: and you mean all running threads, not just like the agent pool
17:44technomancyright
17:44technomancybut in this case actually I think I can pick out a single one to block on
17:44pjstadigyou can enumerate a list of threads from a threadgroup and join them all in turn
17:45technomancypjstadig: yeah, threadgroups ridiculously don't seem to implement any enumerable kind of interfaces
17:45joegallotechnomancy: hehehehe
17:45pjstadigthey do have a very convenient enumerate method though
17:46pjstadigFSVO convenient
17:46technomancypjstadig: "here's an array bro, could ya populate it for me"
17:46technomancyfor very low values of "convenient"
17:46pjstadig"by the way how big should the array be"
17:46technomancyborders on self-parody
17:49dnolenAWizzArd: rhickey thoughts on the matter, http://groups.google.com/group/clojure-dev/msg/2dbd690c7b509b63
18:02symboleIs there a way to monkey patch or proxy a Java object?
18:03hiredmanyes
18:03amalloyi guess it depends what you mean by proxy? you certainly can't monkey-patch it
18:04hiredmanhttp://www.manning.com/forman/ is a neat book, it will tell you how
18:07symbolehiredman: Hmm, I haven't really thought about reflection. I need to create an InputStream and modify one of its methods (close). Right now, I have a function that accepts and InputStream and returns a proxy which closes over the stream. Example, (fn [s] (proxy [InputStream] [] (close [] (foo s)))).
18:07symboles/and/an
18:07sexpbot<symbole> hiredman: Hmm, I haven't really thought about reflection. I need to create an InputStream an modify one of its methods (close). Right now, I have a function that accepts an InputStream an returns a proxy which closes over the stream. Example, (fn [s] (proxy [InputStream] [] (close [] (foo s)))).
18:07symboleOops.
18:07hiredman~jdoc java.io.FilterInputStream
18:07clojurebotfilter doesn't stop
18:07hiredmanclojurebot: jerk
18:07clojurebotPardon?
18:08hiredmansymbole: close is not a method of inputstream
18:08amalloyhttp://download.oracle.com/javase/1.4.2/docs/api/java/io/InputStream.html#close()
18:10amalloyhugod: btw thanks for telling me i can use swank to recompile code that's part of a separate library. it seems obvious if i'd ever thought about it, but it just seemed impossible. so much easier this way
18:11hiredmanamalloy: be sure to check the docs for java6
18:11hiredmanhttp://download.oracle.com/javase/6/docs/api/java/io/Closeable.html#close%28%29
18:12amalloyhiredman: yeah, i know 6 is more accurate, but nobody's going to remove close() from InputStream
18:12hiredmanamalloy: but it comes from Closeable
18:12amalloyso there's a new Closeable interface in 1.5, but InputStream still implements it and it's still a method of InputStream
18:13amalloyhttp://download.oracle.com/javase/6/docs/api/java/io/InputStream.html#close%28%29 - i'm not sure what you mean by "not a method of inputstream", if this isn't a counterexample
18:15hiredman,(reify java.io.InputStream (close []))
18:15clojurebotjava.lang.IllegalArgumentException: only interfaces are supported, had: java.io.InputStream
18:15hiredmanoh right
18:15hiredmanjava.io sucks
18:15amalloy,(proxy [java.io.FileInputStream] [] (close []))
18:15clojurebotjava.lang.IllegalStateException: Var null/null is unbound.
18:15hiredmanhow easy it is to forget
18:15amalloyhaha yes
18:17amalloy,(proxy [java.io.ByteArrayInputStream] [(byte-array 10)] (close []))
18:17clojurebotjava.lang.IllegalStateException: Var null/null is unbound.
18:17symboleSo I take it there's no straight forward way to monkey patch? Is proxy the easiest way?
18:18amalloy&(proxy [java.io.ByteArrayInputStream] [(byte-array 10)] (close []))
18:18sexpbotjava.lang.IllegalStateException: Var null/null is unbound.
18:18amalloyhiredman: what's with that null/null thing? it prints fine in my repl but sexpbot and clojurebot both die
18:19hiredmanamalloy: not sure
18:20hiredmanthat must be anonymous var in the compiler
18:20hiredman,(clojure.lang.Var/create nil)
18:20amalloyah, that makes sense
18:20clojurebot#<Var: --unnamed-->
18:21hiredmanooo
18:21amalloy,@(with-local-vars [a 1] a)
18:21clojurebotjava.lang.IllegalStateException: Var null/null is unbound.
18:31tufflaxI got a stackoverflowerror, but the trace doesn't mention any file of mine. How can I find out where it originated? It just goes on and on like this http://pastebin.com/R7JtWsmZ
18:33amalloytufflax: well, you're probably callling map in a reduce or a loop/recur
18:33tufflaxok
18:34amalloybut i would be surprised if none of your code appeared in the trace at all? it should be in a caused-by or something
18:37amalloytufflax: for example, (first (reduce #(filter #{%2} %) nil (range 1e4)))
18:37tufflaxit does not, i copied all i got which was like a 1000 lines and searched with a regexp
18:37amalloyblows the stack instantly for me, with a trace that looks like yours
18:40amalloyand indeed, none of my code appears in the trace. now that i've actually tried it, that makes sense
18:46tufflaxamalloy: why does that code blow the stack?
18:46amalloy$google clojure stackoverflow dbyrne sieve prime lazy
18:46sexpbotFirst out of 1 results is: recursion - Recursive function causing a stack overflow - Stack ...
18:46sexpbothttp://stackoverflow.com/questions/2946764/recursive-function-causing-a-stack-overflow
18:55tufflaxAh, now I get it :p thanks. Hm, so I guess ill go hunting for such patterns in my code :p
20:12nick_hello
20:13mudgehi nick_
20:13mudgeI'm going to be doing some web programming in clojure and I'm wondering what html library I should use
20:13mudgemaybe hiccup
20:14mudgebut I wonder if anyone has been having fun playing with other stuff
20:15mudgewhat's your favorite html librarie?
20:15mudgeanybody used enlive?
20:17mudgeanybody want to chat about clojure?
20:19EviousI'd like to chat about clojure's syntax.
20:19bendlasmudge: enlive is great
20:19bendlasi'd recommend it
20:20mudgebendlas: cool, I'm readin a tutorial about it now: https://github.com/swannodette/enlive-tutorial/
20:20mudgeI really have no idea about it yet
20:20mudgebendlas: have you used hiccup?
20:20bendlasyes
20:20mudgehow are they different?
20:21bendlashiccup generates html from clojure data structures
20:21bendlasthat means coding html in lisp syntax
20:22bendlasenlive OTOH parses plain html templates
20:22bendlasi.e. the stuff you get from a webdesigner
20:22mudgeyes, mm kay
20:22bendlasyou write transformation rules with css-like selectors
20:23mudgebendlas: sounds neat
20:23bendlasand you can use the same syntax to grab websites
20:24bendlasit is
20:24mudgebendlas: do you recommend any tutorials or resources for learning enlive?
20:25bortrebI have some C code I'm calling through a java JNI interface, and of course, you have to do manual memory management with the java object. I'd like to use the with-open macro from clojure.core to take care of this, but the memory-freeing function is called .deleteLP instead of .close. What is the "right" thing to do in this case?
20:27mudgebendlas: i am reading and getting excited about enlive
20:27amalloybortreb: nothing is "right". i'd probably copy the code for with-open and make it call .deleteLP
20:27bendlasmudge: the enlive syntax file is an essential ref
20:28amalloybut you could instead do something like (let [r (jni-stuff)] (with-open [r* (reify Closeable (close[this] (.deleteLP r)))] ...))
20:28bortrebis there a macro in core that allows one to specify the "closing function", shoule I make my own with-my-garbage-non-standsard-c-stuff macro, or can I use protocols and extend type to make my java wrapper (which I don't control) extend Closeable? OR, should I make my own wrapper object?
20:28bortrebah -- that's it
20:28bortrebthank you amalloy
20:30dnolenEvious: what about?
20:30bortrebI didn't think about creating a nameless manager object to handle closing down my wrapper object
20:30bortrebthat's slick
20:31bendlasmudge: TBH i've learned it mostly from the README and linked resources
20:32Eviousdnolen, I'm trying to use lisp on an obscure functional VM, and am writing utility macros to make it more usable and friendly. I'm not sure what good Lisp style is - and Clojure seems more functional than CL, and prettier than Scheme, so I'm trying to steal ideas from it.
20:32mudgebendlas: okay, thanks
20:33dnolenEvious: curious, what obscure functional VM ? and what lisp?
20:33EviousLisp flavored Erlang.
20:34EviousI notice that Clojure functions wrap individual arg-body clauses in expressions. But (let [n1 b1 n2 b2] body) doesn't. Is this an inconsistency, or is there some subtle motivation behind it?
20:34EviousOr does that stuff simply not matter.
20:34amalloyEvious: wrap them in expressions?
20:35hiredmanEvious: https://github.com/dysinger/lfesl might be useful
20:35Evioushiredman, seen it, don't think it's idiomatic Erlang, writing my own :)
20:35bortreb@Evious I think that it's because a let has only one body, while functions can have more than one body.
20:35Eviousamalloy, ([] 1) as opposed to just [] 1 in http://clojure.org/special_forms#Special%20Forms--(fn%20name?%20(%5Bparams*%20%5D%20exprs*)+)
20:36amalloyEvious: that's only needed when there are multiple bodies
20:36EviousAh. So if functions had only one body (as they generally do in languages that really, really shun side effects) the (let ...) approach makes more sense.
20:36hiredmanclojure doesn't erlang guards
20:36EviousGuards all start with (when ...) so that's okay.
20:36hiredmandoesn't have
20:36bortreb@Evious and if the function only has one body you can dispense with the extra parenthesis
20:36amalloyEvious: you mean, if each body had only one expression
20:37EviousThat would be a more correct way of saying it, yes.
20:37EviousDoesn't the let syntax break auto-indentation, though?
20:37hiredmanhow so?
20:38dnolenEvious: it does not.
20:38hiredman(let [bindings] body) is very regular, easy to parse and indent
20:38amalloyEvious: sure, it means that in (let [x<newline>expr]), x and expr line up instead of expr being indented
20:38EviousBindings is an even-length list, indented in sets of two, right?
20:38amalloybut usually you don't put a newline after x
20:39EviousExcellent, looks like I was worrying about auto-indentation needlessly :)
20:39EviousThe square brackets - are they purely convention, or do they have different semantics?
20:39amalloyvery different
20:39ibdknoxthey're a different datastructure
20:39amalloywell. very is a strong word, i guess
20:39amalloybut they denote vectors
20:40EviousAh. So let takes a vector of bindings, not a list.
20:40amalloy&(let (x 1) x)
20:40sexpbotjava.lang.IllegalArgumentException: let requires a vector for its binding
20:40ibdknoxI believe all binding forms are vectors, right?
20:40pcavs_,(let [x 1 y 2] x)
20:40clojurebot1
20:40joegallosomewhere i read that () is mostly used for execution context, but [] is mostly used for definition context, and that seemed to hold true for me -- but yes, also the definition of a literal list versus a literal vector
20:40amalloyibdknox: yes, but of course that's convention. you could write a binding-creating macro that accepts non-vector forms and converts them to vectors for let
20:41ibdknoxamalloy: yeah, I was just making sure there wasn't something obscure I didn't know about
20:41bendlasEvious: in clojure syntax, by convention, lists are used when the first element has a special meaning, vectors are used else
20:42EviousI see.
20:42dnolenEvious: it's mostly a aesthetics thing. the vector requirement is enforced by the let macro, not by the actual let* special form.
20:43amalloydnolen: oh, i didn't know that. neat. lemme try it! ##(let* (x 1) x)
20:43sexpbotjava.lang.IllegalArgumentException: Bad binding form, expected vector
20:43EviousSyntax = brackets and atoms, expression = a set of matching brackets containing atoms or expressions, and form = the shape and structure of an expression? (Is (let [...] ...) syntax, or a form?)
20:43dnolenamalloy: huh, I guess reinforced again by let* ?
20:44amalloyEvious: uh. is happiness a word or an idea?
20:44bendlasspeaking of that makes me wonder why we don't use maps for syntactic positions where groups of two are expected
20:44dnolenamalloy: yeah enforced by the Parser.
20:44bendlaslike in bindings
20:44EviousPeople yell at me for misusing words all the time, I don't want to call stuff "syntax" in documentation and then turn out blatantly wrong :)
20:44amalloybendlas: they don't guarantee order
20:45bendlashmm :/
20:45ibdknoxbendlas: I thought the same thing at first lol
20:45bendlasalso wouldn't be to easy on the eyes
20:45bendlass/to/too
20:45sexpbot<bendlas> also wouldn't be too easy on the eyes
20:46EviousWhere can I find documentation on let* and other low level primitives?
20:46ibdknoxdnolen: in terms of the enforcement, I think that's actually a good thing
20:46dnolenibdknox: for sure.
20:46EviousAnd one last question: is it possible to learn and understand Clojure, without learning a thing about Java?
20:46bendlasEvious: no
20:47dnolenEvious: there's a page on special forms on clojure.org
20:47amalloyyes and no
20:47ibdknoxI think you can
20:47amalloyclojure the language stands on its own without the . special form
20:47Eviousdnolen, it only covers (let ...) though, and someone mentioned let*
20:48amalloybut it's missing a lot of functions that you'd expect from a real language, because you can use java built-ins instead
20:48technomancyEvious: you don't need to learn how to write in the Java programming language. you do need to learn how to interact with certain java classes and libraries.
20:48bendlasok, it's depending on the real-worldness of the problems you're dealing with
20:48dnolenEvious: you can get pretty far along, but there are certain bits you really must understand - i.e. classpath
20:48EviousCool.
20:48dnolenEvious: if you writing high performance stuff you'll need to expand your knowledge of Java as well.
20:48amalloyEvious: "real" special forms are poorly documented. the best i've found is by reading the source of the compiler; they're all listed in once place
20:48EviousIs that due to clojure focusing on immutability more than Java?
20:49ibdknoxdnolen: are you talking primarily about type hints?
20:49dnolenEvious: idiomatic Clojure is "fast enough" faring better than other dynamic langs. But if you want to write something like PersistentVector you going need to know something about Java.
20:49dnolenibdknox: no.
20:50bendlasyou need to know java to make head and tails of clojure stacktraces
20:50ibdknoxbendlas: haha and a prayer ;)
20:50Eviousbendlas, awesome, that's the answer I was looking to find :D
20:50dnolenbendlas: heh, I think the stacktraces get a bit of bad rap, I don't have much trouble w/ them these days.
20:51bendlasdnolen: do you know java?
20:51ibdknoxfor the most part I agree
20:51dnolenbendlas: not well.
20:51ibdknoxthere are still some really crap traces though
20:51bendlasdnolen: interesting ..
20:51bendlasibdknox: yeah, ever mistyped an (ns ..) clause?
20:52ibdknoxbendlas: oh man, yes
20:52bendlas* cannot be cast to ISeq is really notorious
20:52ibdknoxmy first time with Clojure I did something stupid like that
20:52ibdknoxtook me an hour to figure out what the hell was going on
20:53seancorfieldamalloy: could you point me at where in the clojure compiler source the special forms are listed? just curious
20:53seancorfieldeven an approximate pointer would be enough, tx
20:53dnolenbendlas: ibdknox: yeah, those kinds of things don't burn me much anymore. and honestly aren't much worse than my experience with certain classes of cryptic errors in other langs.
20:53amalloyseancorfield: just search LispReader.java for "deftype*"
20:53seancorfieldthanx!
20:54bendlasdnolen: true, but in clojure they lurk in such basic functionality as clojure.core/ns
20:55hiredmanamalloy: LispReader?
20:55bendlascan't really tell a beginner not to use it ;)
20:55amalloyhiredman: am i wrong, and it's Compiler?
20:55hiredmanseancorfield: I think he meant Compiler.java
20:55amalloyi forget which is where
20:56amalloygood save
20:56ibdknoxdnolen: also true, it's been a while since I've run into something that really stumped me
20:56seancorfieldthe opcodes list? hiredman amalloy
20:58ibdknoxseancorfield: line 5716 has the definition for the let form
20:58ibdknoxas an example
20:58dnolenany continuation passing style gurus here, can this be reduced of written better? https://gist.github.com/1055402
20:58dnolens/of/or
20:58sexpbot<dnolen> any continuation passing style gurus here, can this be reduced or written better? https://gist.github.com/1055402
20:58amalloyseancorfield: yes, that's the list. they aren't all really special forms (eg clojure.core/list), but they're used often enough by the compiler that you can probably guess
20:59hiredmandnolen: looks backwards?
20:59seancorfieldline 101: static final public IPersistentMap specials = PersistentHashMap.create(
20:59hiredman^-
21:00mudge(hn-headlines)
21:00mudgeoops, this is not my repl
21:00seancorfieldthanx amalloy etc
21:00seancorfieldloop and let have the same parser... nice :)
21:01hiredmandnolen: is the returning of the single argument fn part of the cps? generally for cps you don't return anything
21:03ibdknoxmudge: what are you doing with the HN headlines? :)
21:03ibdknoxassuming hn = hackernews
21:05mudgeibdknox: i am following the Enlive tutorial: https://github.com/swannodette/enlive-tutorial/
21:07ibdknoxah :)
21:08Penten/#scheme
21:10dnolenhiredman: hmm, yeah, in this case I want to be able to add something to the computation later.
21:18tomojhuh, a function named f| works in clojure but breaks in the slime repl
21:18amalloytomoj: | has special meaning in CL, and the slime parser treats it as such
21:18tomojwonder if there is a special key for "just send this damn string"
21:19amalloyC-ret?
21:19amalloyfailing that, i know C-u ret works
21:19tomojhuh
21:19tomojheh
21:20tomojit works, but the return values is printed immediately after the closing paren of the input, then a newline and a bolded prompt
21:20tomojthat prompt works normally and the next is back to unbolded
21:20wastrelhello friends
21:20tomojbizarre
21:24tomojyou can have vars like %foo, but then you can't use them inside #()...
21:45amalloytomoj: yeah, i don't love how the lexer treats %
21:45amalloy&(#(inc%) 2)
21:45sexpbot⟹ 3
21:45amalloyie, they seem to be single-character tokens except when the next character is a number
21:46amalloy&(#(+ 3%) 2)
21:46sexpbot⟹ 5
21:49ask_mehi
21:49ask_mei'm thinking a bit about bok about clojure
21:50ask_meProgramming Clojure By Stuart Halloway OR Practical Clojure By Luke Van der Hart OR The Joy of Clojure: Thinking the Clojure Way By Michael Fogus, Chris Houser
21:50ask_mewhich one is the best for the begginer?
21:50ask_meonly these i may buy
21:51technomancyany last-minute things to address before leiningen 1.6 is released?
21:53ask_meanyone?
21:53clojurebotPlease 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.
21:57technomancybut you'll want to buy the Joy of Clojure eventually
21:57technomancyfor sure
22:11seancorfieldClojure Programming by Chas Emerick, Brian Casper and Christophe Grand is really good IMO
22:11seancorfieldbut, yes, Joy of Clojure is a "must have" once you're beyond the basics
22:12seancorfieldI have JoC, Clojure in Action and Clojure Programming all on my iPad / iPhone / desktop / netbook and enjoy reading (and re-reading) all of them
22:12technomancyclojurebot: peepcode
22:12clojurebotpeepcode is a commercial screencast series; see the Clojure one at http://peepcode.com/products/functional-programming-with-clojure by technomancy
22:13seancorfieldstu's book is a bit out of date... is he doing a 2nd ed?
22:17technomancyit doesn't cover deftype &c, but it's debatable whether that belongs in an introductory text anyway
22:17technomancyI think the only actual breakage revolves around ^ as meta
22:43seancorfielddoes chris redinger hang out here? i want to contact him about the clojure success stories page...
22:43seancorfieldah, there he is: redinger ...
22:44seancorfieldhmm, idle for a week
22:51mudgeexit
22:51mudgequite
22:51mudgequit
22:51mudgecan't get out of my irc client
22:54amalloytoday has been an exciting day for people typing the wrong things into #clojure
23:20bprquick question: is the behavior of hash shown in this paste by design? https://gist.github.com/1055556
23:24hiredmanbpr: arrays are mutable so hashing different arrays with the same values to the same thing is a bad idea
23:24bprok, that's sensible
23:38amalloybpr: i'd also make the point that there's no reason for clojure to treat arrays specially when java doesn't: (hash some-array) just returns (.hashCode some-array)
23:42technomancyleiningen 1.6.0 released
23:42technomancylein update away
23:42technomancynow with search magic
23:42hiredmanyay!
23:42pcavs_technomancy: ooh, sounds cool
23:42coopernursecool, updating now
23:43pcavs_wait, don't you mean upgrade?
23:43technomancypcavs_: ah, you are correct.
23:43pcavs_w/e weenie question/point
23:44Raynestechnomancy: Clojars search stuff?
23:44technomancyRaynes: search for any remote repo that publishes indices
23:44technomancyclojars, maven central. sonatype, etc.
23:45RaynesNeat.
23:45Raynescake can search clojars, but that's about it. I took that stuff from cljr.
23:46RaynesI'll check out your stuff when I get some time.
23:46technomancysure, it's just basic lucene
23:46technomancyhopefully I can integrate it into the clojars web app soon
23:46coopernursetrying out the search now
23:47seancorfieldtechnomancy: i get an exception on lein test now
23:47seancorfieldException in thread "main" java.lang.NullPointerException
23:47seancorfield at clojure.core$deref.invoke(core.clj:2078)
23:47seancorfield at leiningen.util.injected$run_hooks.invoke(NO_SOURCE_FILE:1)
23:47seancorfield at leiningen.util.injected$prepare_for_hooks$fn__14$runner__15.doInvoke(NO_SOURCE_FILE:1)
23:47seancorfield at clojure.lang.RestFn.applyTo(RestFn.java:137)
23:47seancorfieldjust upgraded to 1.6.0 :)
23:48seancorfieldany info i can provide to help debug that?
23:50seancorfieldlooks like a problem with 1.3 compatibility
23:50technomancyseancorfield: using test selectors?
23:51seancorfieldnope, bare bones 1.3.0 clojure project
23:51seancorfieldlet me do a clean test
23:52seancorfieldyup, lein new test13; cd test13; vi project.clj ;; change clojure version to 1.3.0-beta1; lein clean, deps, test
23:52seancorfieldfails with that exception on test task
23:53technomancythe heck; it's failing derefing an atom
23:54seancorfieldat least the failure is easy to repro :)
23:56technomancyI don't think this is a lein bug
23:56seancorfieldlein 1.5.0 works, lein 1.6.0 fails :)
23:57technomancyyeah, with-meta is just failing to attach metadata to a function