#clojure logs

2011-12-27

00:08mrb_bkfun question
00:26shalesmrb_bk: saw your email about an unpack port. does this fit the bill? https://github.com/geoffsalmon/bytebuffer
01:25sunng,(conj '(1 2 3) 4)
01:25clojurebot(4 1 2 3)
01:26sunng,(conj [1 2 3] 4)
01:26clojurebot[1 2 3 4]
01:28amalloyibdknox: you don't get billed for the dyno-hours it sits idle. i imagine with the paid tier there's an always-on option as well as the "nah, go ahead and power it down" behavior
03:43gf3hi gents, I'm new to clojure, and I'm wondering if someone can point me to the "clojure way" of doing things
03:43gf3I am writing some ring middleware, and I need to maintain a list of routes somewhere, this list will have to be mutable. How can I go about this as cleanly and as clojure-y as possible?
03:51amalloywell the "clojure way" would probably be to start by double-checking what you need a mutable list for
03:54kralnamaste
04:02antares_zzzzway
04:02antares_zzzzoops
04:06gf3amalloy: hi! been reading a lot of your code on GH, thank you
04:06amalloyoh cool, glad to be of service, corrupting the younglings with my code
04:07gf3amalloy: I'm sure I'm just not approaching the issue correctly, my middleware should hold a list of routes, and when it encounters those routes in a request, it will do some work
04:07gf3but this list of routes is what's bugging me
04:08amalloymhm, but so far i don't hear it changing anytime
04:08gf3amalloy: the user of the middle way can add/remove routes to "watch"
04:08gf3*middleware
04:08gf3how do I store that list in a persistent way that isn't some gross global mutable?
04:10amalloywell, when would you really want to change it dynamically? i can only see that happening if it's some kind of debug middleware
04:13gf3amalloy: I suppose it's unlikely
04:13amalloyanyway, a short-term solution is like...just use an atom. but a long-term solution is probably...realize you don't want to solve this problem
04:16amalloy(defn dyn-routes [init] (let [a (atom init)] [a (fn [req] (let [current-routes @a] (...)))]))
04:16amalloynow dyn-routes returns a pair [routes-atom, handler]
04:17amalloyinstall the handler wherever you want, and save the atom for later changing
04:18gf3iiiiinteresting, thank you
04:18amalloybut *really* it would be more composable to wrap, not a list of routes, but an underlying handler. maybe that handler is just some routes, maybe it's something else. just hold whatever it is in an atom, and swap that out with something different later
04:18gf3amalloy: I was just looking at how you do things like triggers/etc in ciste
04:18amalloyi have no idea how ciste works
04:24gf3amalloy_: good call on the atoms, looks like ciste just rebinds stuff, thank you
06:43licenseraloa
07:53vijaykiranhow can I add test-only dependency in lein ?
08:39gf3vijaykiran: :dev-dependencies [[some-pkg "1.2.0"]]
09:01vijaykirangf3: thanks!
09:01gf3np
09:21clojure_0000I can't do (apply and '( true true false tree)) because and is a macro. How do I take the and of a list of booleans?
09:32jonasenclojure_0000: (every? identity '(true true false tree))
09:34jonasenclojure_0000: or maybe (reduce #(and %1 %2) [true true false true])
09:36sandy1986Hi I like to strore collections of items in a memcached entry. But they can only be 1mb big. How to deal with this for bigger collections? http://oi41.tinypic.com/vcuj6h.jpg
09:37sandy1986Store each item and manage them with a key for the namespace? Or linking the 1MB buckets?
09:40clojure_0000jonasen: ended up going with : (apply (fn [x y] (and x y)) ... )
09:40clojure_0000jonasen: the identity trick is cute
09:40clojure_0000#(and %1 %2) is pretty cool too
10:33TimMcWow, writing Clojure without internet access is *hard*.
10:34TimMcMost libraries have shitty or nonexistent documentation, so I have to use a search engine instead of grep.
10:36stuartsierraread the source
10:39bsteuber1,(conj {:a 1} {:b 2})
10:39clojurebot{:b 2, :a 1}
10:39bsteuber1that's surprising to me
10:40TimMcstuartsierra: Ugh, I know.
10:40TimMcstuartsierra: Source doesn't convey intent.
10:40stuartsierraNeither does bad documentation.
10:41sandy1986Does anyone know why enlive converts everything into iso-8859-1 ?
10:41sandy1986Even UTF-8 Input
10:47stuartsierrasandy1986: maybe something to do with the XML parser
10:48sandy1986stuartsierra: any idea what I can try to fix it?
10:48stuartsierrano, sorry
11:02cemericksandy1986: can you output UTF-8 outside of enlive?
11:08sandy1986yes cemerick
11:08sandy1986works fine
11:08sandy1986repl etc.
11:08sandy1986but when I pass it to the enlive template and recieve the result it is iso-*
11:11TimMcsandy1986: Ew, I'll have to take a look at that with my own enlive-using project.
11:12sandy1986mhhh have written the output of enlive to the console
11:13clojure_0000why are all pullup towers on amazon only ~7 feet tall? I want something ~8 feet tall, so I can jump up to grab it, and be able to hant w/o bending knees
11:13sandy1986also utf-8 mhh
11:13clojure_0000hmm; I think I am in the wrong channel
11:13sandy1986moustache, ring , jetty
11:13sandy1986there must be the problem
11:13TimMcsandy1986: Ah, good.
11:18sandy1986netty works ...
11:19AeroNotixhi, is the guy who runs 4clojure here?
11:19mdeboardAeroNotix: You mean amalloy ?
11:19mdeboard:)
11:19TimMcAeroNotix: Several folks run 4clojure.
11:19AeroNotixOh, ok.
11:19TimMcIs it down, or what?
11:19mdeboardorite, sorry I still associate it with him
11:20AeroNotixNo, I just found a little bug. I presume it's already known though
11:20TimMcAeroNotix: You can also ask in #4clojure if you want a more targeted set of folks.
11:20AeroNotixahhh interesting
11:20AeroNotixbrb
11:20sandy1986lein ring server << causes the encoding problem
11:22sandy1986maybe it is also caused by netty vs jetty
11:23TimMc"lein ring server", is that a new command? I seem to recall some discussion of it recently.
11:26sandy1986TimMc: It is a plugin for lein
11:26sandy1986Where do you bring the jetty / netty server construction call in?
11:26sandy1986when I add it to core.clj no more actions like "jar" and "compile" work, cause the server starts and waits for requests
11:27sandy1986jetty is causing the problems
11:27sandy1986changed (defonce server (run-jetty #'routes {:port 8080 :join? false})) ;(defonce server (run-netty #'routes {:port 8080 :join? false}))
11:28sandy1986and there are encoding problems again
11:31pandeirowhat's the best way to test a map for multiple keys?
11:34sandy1986http://goo.gl/kFVPB
11:34sandy1986nice ;) my answer
11:34TimMcpandeiro: You just want to know whether a map contains all of the keys?
11:34pandeiroyeah
11:35TimMcpandeiro: Is there any chance that any of the values would be nil or false?
11:35TimMc*values for those keys
11:35pandeiroumm, not really
11:36pandeiroany is a big word
11:36pandeirobut probably not
11:37TimMc&(every? (partial contains? {:a 3 :b 4 :c 5}) [:a :c])
11:37lazybot⇒ true
11:37TimMc^ That's the safer way to do it. There might be some trick with sets or keywords that only works if the attached values are logical true.
11:38sandy1986How to (.setCharacterEncoding response "UTF-8") on [ring.util.response :only [response]]
11:39pandeiroTimMc: cool, thanks... i was in the neighborhood but missing the fn composition
11:41sandy1986maybe I need only to add :character-encoding
11:41TimMcpandeiro: Here's an example of a trick that only works with keyword (or symbol?) keys and logical-true values: ##(every? {:a 1 :b 2 :c 3} [:a :c])
11:41lazybot⇒ true
11:42TimMcNo, wait... the map is the function, so anything can be used as a key. The val problem is still there.
11:42pandeiroTimMc: if the values are false or nil...? it returns false?
11:42TimMc&(every? {:a 1 :b 2 :c nil} [:a :c])
11:42lazybot⇒ false
11:42pandeironice one
11:42TimMc&(map {:a 1 :b 2 :c nil} [:a :c])
11:42lazybot⇒ (1 nil)
11:43TimMcI don't like those tricks, they're a bit dangerous.
11:43TimMcGood for golf, though.
11:44sandy1986How to add the key :character-encoding to the response: https://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/util/response.clj#L21
11:45jonasenpandeiro: ##(every? (set (keys {:a false :b 4 :c nil})) [:a :c])
11:45lazybot⇒ true
11:45pandeirojonasen: any advantage to that over just using the map?
11:46pandeiroah i see
11:46TimMcjonasen: And now the only danger is nil or false *keys*, which is pretty unlikely.
11:46pandeiroin my case a nil or false val should return false
11:46pandeiroso TimMc's shortcut is perfect
11:46TimMcAh, OK.
11:46pandeirothanks guys
11:46pandeirothis is a great language :)
11:46pandeiroreally enjoying the new Clojure in Action book
11:47jonasenTimMc: is nil even allowed as a key?
11:47TimMc&({nil 5} nil)
11:47lazybot⇒ 5
11:48TimMcYou really should restrict your keys to keywords, symbols, and strings though.
11:49jonasenI don't think I've ever seen nil as a key. If nil means nothing, then {nil 5} would mean nothing maps to 5 which is just weird
11:50TimMcI've used it.
11:50TimMcI had a cache of configurations where nil (null, it was Java) indicated the default.
11:50jonasenTimMc: ok
11:50AeroNotixpandeiro: Who is that book aimed at?
11:50TimMcI later changed that since the default's value could change, but that was unrelated.
11:51pandeiroAeroNotix: amateurs like me, definitely :)
11:51TimMcjonasen: Not all java.util maps accept null keys, by the way.
11:51TimMc(I think.)
11:51pandeiroalthough i think it ramps up pretty quickly, scanning the chapter titles (i'm only on 2)
11:51AeroNotixpandeiro: I'll check it out. I was sorely disappointed with Practical Clojure, I should have checked the page count before buying.
11:51TimMcsandy1986: I think you specify the character encoding using a header.
11:52pandeiroAeroNotix: i really like the style, more straightforward than joy of clojure
11:53AeroNotixThanks for the recommendation.
11:53sandy1986(defn utf8response "Returns a ring skeleton withheaders." [body] {:status 200 :headers { :content-type "text/html;charset=UTF-8" :character-encoding "UTF-8"} :body body}) ??
11:53lazybotsandy1986: Uh, no. Why would you even ask?
11:54sandy1986clojure.lang.Keyword cannot be cast to java.lang.String
11:54TimMcsandy1986: Looks like there's a headers function farther down.
11:54sandy1986farther down?
11:55TimMcin response.clj
11:55TimMcAnd it wants "Character-Encoding", not :character-encoding.
11:58sandy1986I'll try
11:59sandy1986ring.util.response$response cannot be cast to clojure.lang.Associative
12:00sandy1986((header response "Character-Encoding" "UTF-8") (apply str (t/index (map :task (get-todos))) )))
12:03sandy1986TimMc: what is clojure.lang.Associative? What's the problem here?
12:06AeroNotixis there an IRC for clojure noobs?
12:07RaynesNobody minds trivial questions/discussion here.
12:07sandy1986Yeah AeroNotix , that's why I am here ;)
12:08AeroNotixok
12:08AeroNotixI keep getting a mismatched parens error on some code, it's a really nooby question.
12:09AeroNotixaaaaand I've just fixed it
12:09RaynesSometimes all it takes is to talk about it.
12:09pandeiroRaynes: why is that?
12:09AeroNotixdammit, a loop vector was causing it, I had (loop [var val [var2 val2])
12:10pandeiroAeroNotix: do you use emacs?
12:10AeroNotixI do
12:10pandeiroparedit?
12:10AeroNotixNope
12:10AeroNotixI was just going to ask
12:10AeroNotixis there a plugin to highlight matching-parens
12:10AeroNotixI take it paredit is that plugin
12:10pandeiroit is kind of a nazi, but you avoid stuff like that
12:10pandeirono just highlighting?
12:10pandeirothat's built in
12:11AeroNotixI have a Python editor where if I put my cursor next to a paren, it'll highlight the matching paren it's next to. Anything like that for emacs?
12:11pandeirohttps://github.com/pandeiro/dotemacs/blob/master/my-general.el
12:11sandy1986(defn utf8response "Returns a ring skeleton withheaders." [body] {:status 200 :headers { "Content-Type" "text/html;charset=UTF-8" "Character-Encoding" "UTF-8"} :body body}) << works :)
12:11sandy1986don't know how to do it with "header" function in ring ...
12:12pandeiroand then paredit is a tool that inserts and enforces matching parens/brackets/quotes etc with a whole set of functions for manipulating sexps
12:12AeroNotixI'll dl it
12:13pandeiroyou saw show-paren-mode though?
12:14AeroNotixI'll have to mess with it. I'm a super-emacs-noob
12:14pandeiroi am as well, about 4 months in
12:15AeroNotixI take it I just create the paredit.el file and put it in my load-path and then require it in my .emacs?
12:15pandeiroAeroNotix: the wisest thing you can do is use package.el and marmalade
12:15pandeirotechnomancy has a starter kit that does all that for you i believe
12:15pandeiroi did it manually though, it's not too complex
12:16AeroNotixI've used that before. I keep re-installing emacs when I mess something up (bad learning experience, I know)
12:16pandeirobasically then you can do M-x package-install
12:16AeroNotixI'm gonna stick with it now with the current incarnation as I can use it
12:16pandeirooh ok you know it
12:16AeroNotixYeah, just don't have it atm
12:16AeroNotixthanks for advice
12:16pandeirobut yeah you can just grab paredit then and require it
12:17pandeiroand for the matching parens highlighting it's just (show-paren-mode t)
12:18AeroNotixthanks
12:19sandy1986technomancy has a starter kit that does all that for you i believe << where is the stater kit?
12:19pandeirosandy1986: on his github
12:19pandeiroemacs-starter-kit i think it's called
12:42TimMcparedit is more than a highlighter or balance-enforcer -- it is a structural editor.
12:42TimMcYou edit lists, not strings.
12:42TimMctrees, really
12:59choffsteinDoes anyone know if incanter's matrices have an "update" ability with functionality similar to the "sel" function?
13:15sandy1986What editor du you prefer?
13:15Xenocorpemacs
13:15sandy1986technomancy starter Kit?
13:15AeroNotixi just use clojurebox
13:19darrintI'm having trouble figuring out how to idiomatically use prxml to find a particular tag. For instance, I have a vector of tags. I'm looking for the map that has {:tag :first_name}.
13:28sandy1986!google v
13:29sandy1986ahh clojurebox is for windows
13:30sandy1986can I set JAVA_TOOL_OPTIONS inside of a clojure application?
13:39TimMcdarrint: (first (filter ...))
13:39sandy1986how to carry parts of a funtion to the end (so they are returned) ? => let ?
13:40sandy1986(defn save-todo [name] (let [todos (get-todos) entry (todo. name true (gen-timestamp))] (with-mc db-nodes (replace-item "todos" (conj todos entry)))))
13:40darrintTimMc: Thanks!
13:40sandy1986I want save-todo to return (conj todos entry)
13:40sandy1986but it should be passed to replace-item
13:41sandy1986now it returns a future from replace-item
13:41TimMcsandy1986: Just add another clause to the let.
13:41TimMcsandy1986: You know that let can have multiple statements in its body? ##(let [] 3 4 5)
13:41lazybot⇒ 5
13:42sandy1986Yes, like in my example
13:42sandy1986todos and todo ;)
13:42sandy1986ahh in its body?. .. ahhh
13:43TimMcyeah, just bind the conj's result and return that as the last expression.
13:43sandy1986but just to add another (conj todos entry) looks wired
13:43TimMc(let [..., foo (conj todos entry)] ... foo)
13:47sandy1986(defn save-todo [name] (let [todos (get-todos) entry (todo. name true (gen-timestamp)) result (conj todos entry)] (with-mc db-nodes (replace-item "todos" result) result)))
13:47sandy1986still returns the operationFuture
13:51sandy1986even like this:
13:51sandy1986(defn save-todo [name] (let [todos (get-todos) entry (todo. name true (gen-timestamp)) result (conj todos entry)] (with-mc db-nodes (replace-item "todos" result)) result))
13:51sandy1986but result is the last thing in let !?
13:53TimMcShould work.
13:54sandy1986worked, my repl had problems
13:56amalloyTimMc: strongly disagree re: restricting map keys to keywords, symbols, and strings, if you meant that as general advice
13:58TimMcamalloy: Mrh.
13:59TimMcThere are (at least) two uses of maps -- data structures with known-name keys, and lookup tables.
13:59TimMcI still think my advice holds for the first case.
13:59darrintCan I ask emacs-slime to unload, compile, then load my file? I'm finding that sometimes old bindings allow me to compile code that won't compile in a fresh repl.
14:10raekdarrint: one solution is to run remove-ns in the repl
14:10raekfollowed by a require
14:12tmciverraek: darrint: I'm interested in the answer to this question as well. I suppose remove-ns will not work if you 'use'd your lib?
14:13tmciverbecause that brings those symbols into the current namespace?
14:13kzarCan you access meta data using destructuring?
14:13tmciverPerhaps you meant to remove-ns the repl's namespace.
14:18Rayneskzar: Not sure I follow.
14:19RaynesYou can get metadata and destructure it, of course: ##(let [{:keys [name]} (meta #'+)] name)
14:19lazybot⇒ +
14:20kzarRaynes: Yea, I guessed you couldn't but thought I'd ask. It's because clutch puts some stuff in meta data that it used to put in the result map.
14:20amalloywouldn't that be funny though? (let [^{:keys [m]} {:keys [a b]} ^{:m blah} {:a 5 :b 20}] [a b])
14:22TimMcamalloy: Syntax would be tricky...
14:22amalloyTimMc: not really. if there's metadata on a destructuring form, then destructure the meta too
14:23TimMcI know almost nothing about metadata, though. :-/
14:24TimMc&(meta `^{:keys [m]} ())
14:24lazybot⇒ {:keys [clojure.core/m], :line 1}
14:24TimMcI guess that would work.
14:24sandy1986Does anyone know javascript?
14:25TimMcCertainly.
14:25sandy1986what is the best tool to modify html/javascript in the browser
14:25sandy1986to rapid test things
14:25TimMcsandy1986: Each browser has an inspector tool.
14:25TimMcSome are built-in. For Firefox, get the Firebug add-on.
14:26sandy1986yes, but i do not only want to inspect. I want to change things
14:27TimMcThat's what they do.
14:28RaynesChrome has an excellent tool for this built in. You can use Firebug in firefox.
14:28pandeiroChromium +1
14:28TimMcIE
14:28pandeiroCtrl-Shift-I
14:28TimMcIE's inspector is shit.
14:28pandeirowhy wouldn't it be?
14:28sandy1986Chrome has an excellent tool for this built in << ? I use chrome but I can't change the javascript code
14:28sandy1986only view it
14:28pandeirosandy1986: Ctrl-Shift-I
14:28pandeiroclick on Console
14:29TimMcsandy1986: That's pretty standard.
14:29RaynesI'm pretty sure you can click on 'scripts' and edit the JS directly as well.
14:30sandy1986I opened the script but I can not edit it
14:31darrintCan I ask slime/clojure-mode to pretty print a large data structure in place in a buffer?
14:31arthurdenturesandy1986, in chrome 16 at least you can double-click on the script contents in the inspector and just start typing. not sure about older versions.
14:32tmciverdarrint: Yes, but it's not a clojure-mode thing: (use 'clojure.pprint) (pprint 'my-data-structure)
14:37darrinttmciver: good enough for this. Thanks.
14:42blcooleysandy1986: once you open the Scripts panel in the Developer console, there is an edit button at the bottom of the panel. You have to click that to edit the scripts, I think.
14:42sandy1986It is grey, I can't klick it
14:45TimMcReload.
14:45blcooleyyou have to disable pretty print mode. The braces next to the edit are a toggle for pretty print mode.
14:48timvisherhey all
14:49timvisheri have clojure-mode 1.11.5 installed, "GNU Emacs 24.0.90.1 (i386-apple-darwin10.8.0, NS apple-appkit-1038.36)
14:49timvisher of 2011-10-27 on 184-243-147-41.pools.spcsdns.net", and clojure-jack-in is saying "error in process filter: Symbol's function definition is void: slime-output-buffer [2 times]" when I try to run it
14:49timvisherany thoughts?
14:50timvisheri just upgraded clojure-mode so it could be something weird their
14:50timvisherthere*
14:51romanandreghey guys, I'm trying to implement some basic leiningen tasks on my project (in a leiningen subdir), yet whenever I'm running the task with imported leiningen libraries, I get `FileNotFoundException` with basic imports from leiningen
14:51romanandreghow can I solve this issue? :-o
14:54dsantiagoIf you know the name of a record type, is there any way to get a list of its fields?
14:54tmcivertimvisher: I *think* that's an error I've seen when running clojure-jack-in after killing a previous slime. The only solution I know to that problem is to restart emacs :/
15:04timvishertmciver: that didn't seem to do the trick. Might be something more widespread: https://github.com/technomancy/swank-clojure/issues/92
15:04timvisherbut it looks like that was on an old version
15:05tmcivertimvisher: possibly. I'm still on emacs 23 so it may be unrelated. sorry.
15:06timvishernp
15:06timvisherthanks for trying. ;)
15:10TimMcromanandreg: You mean you are trying to :require a leiningen namespace and it is failing?
15:11romanandregTimMc: yes, exactly that :-)
15:11pandeiroif i run lein deps to add a new dependency while a swank clojure server is already running, how can i get it to load the new lib? it's there in lib/ but swank says it can't find it on the classpath
15:16TimMcpandeiro: That's because swank was started with a classpath that explicitly listed those jars.
15:16pandeiroTimMc: i see, so how do i do?
15:16TimMcLike, as a command-line argument or something.
15:16TimMcI don't know how to update it.
15:17pandeiroC-x C-c yes emacs -nw
15:17pandeiroi guess
15:17TimMcThere might be a way to patch in a classpath element later...
15:17pandeiroi see there's a fn clojure-load-file
15:17pandeironot sure if that helps
15:17arthurdenturehow about M-x slime-quit-lisp?
15:17pandeiroprobably not
15:18TimMcromanandreg: And your ns has something like (:use [leiningen.deps :only [deps]]) ?
15:18arthurdentureor, for that matter, running M-x clojure-jack-in prompts me that an existing swank is running and should it kill it.
15:18pandeiroarthurdenture: huh, mine didn't do that probably because i killed the slime repl running process
15:18romanandregTimMc: (ns leiningen.generative (:require [leiningen.core.eval :as eval]))
15:18pandeiroand slime-quit-lisp doesn't do it
15:19romanandregI have a leinigen/generative.clj file in my project
15:19pandeiroi made a mess, i will just restart
15:20TimMcromanandreg: So, somehow lein's own jar isn't being added to your classpath.
15:20romanandregTimMc: yes, when I see lein class path, leiningen is not there
15:21TimMcromanandreg: I didn't have to do anything special to trycljs' project.clj other than add the :hooks declaration. Maybe there is a typo in that?
15:21romanandregTimMc: I tried adding leiningen-core to the dependencies, but I saw this is only working with a SNAPSHOOT
15:21romanandregSNAPSHOT*
15:23romanandregTimMc: :hooks declarations? I'm not adding any hooks to the project.clj, maybe that's it? => https://gist.github.com/23ba74ddbe42c5028a83
15:24brett_hDoes "for" do something with stdout or side effects? Why does this return 1 but print nothing? (let [x [1 2 3]] (for [i x] (println i)) 1)
15:25dsantiagobrett_h: for generates a sequence using the body of the for statement for the value of each item.
15:25dsantiagoYou want doseq.
15:26brett_hdsantiago: thanks, I'm still a bit confused why that wouldn't print as a side effect though
15:26dsantiagoBecause sequences are lazily evaluated, so it returns a sequence, no one wants it, it's ignored and moves on.
15:27brett_hgotcha, thanks
15:27brett_his doseq not lazy in that way?
15:27dsantiagoExactly.
15:27brett_hI'm doing something for the sidefeffects
15:27brett_hthanks
15:28timvisherfwiw, downgrading from 1.4.0 to 1.3.3 seemed to do the trick for me
15:29pandeiroin the repl is there a way to see all the java methods an object instance has?
15:33Vinzentis it possible somehow to reify class known only in runtime? something like (let [c (Class/forName "...")] (reify c ...)) doesn't work
15:34clojure_0000clojure.core is auto loaded for all of my *.clj files. I have a file my_awesomeness.clj. I want it to be auto-loaded for all of my *.clj files. How can I make this happen?
15:34clojure_0000I don't wnat to have to :require my_awesomeness in every *.clj file of mine
15:38theignoratidoes anyone know what is wrong with (command {:renameCollection "db.x" :to "db.y"}) using congomongo?
15:44juhu_chapahi guys! is there a leiningen channel?
15:53TimMcjuhu_chapa: This one, as far as I know. :-)
15:54TimMcromanandreg: Oh, you're not writing a lein task? I guess lein tasks automatically have lein added to their classpath, or perhaps are run from inside lein's context.
15:56juhu_chapaTimMc: I just found the #leiningen channel
15:56juhu_chapa:P
15:57chewbrancaanyone familiar with why hiccup doesn't support setting attributes in form helpers? is there a reason or is this just an issue awaiting a pull request?
15:59sandy1986First working example
15:59sandy1986http://78.34.71.100:8080/
16:00sandy1986Clojure application, using memcached as backend to store data
16:01TimMcWow, some classy test data there.
16:01Xenocorphahaha
16:02Xenocorpmight need some language filtering on it if it's going to be public
16:02sandy1986tzzz
16:02Xenocorpalso, it seems to add from the front, rather than the back
16:03sandy1986yes, :)
16:03sandy1986$(x).prepend,.. easy to change it to append. But I think it's more fun this way
16:03Xenocorpdoes anyone know if I can define implementations of a function which takes a seq as an arg depending on the length of that seq
16:05Vinzentis it okay to maintain some state in compile time? Like, one macro adds some information to the atom, then other one uses it
16:05sandy1986spam-ed it, shame on you
16:06XenocorpVinzent: talking to me?
16:06VinzentXenocorp, no, to the channel
16:06Xenocorpoh ok
16:07TimMcXenocorp: I highly doubt it, except in the case where the function is applied to a seq.
16:07Xenocorpah ok
16:07Xenocorpso I can't do
16:07Xenocorp ([number]
16:07Xenocorp number)
16:07Xenocorp ([number (= (count num-seq) 2)]
16:08Xenocorpwhere number and num-seq are args
16:08VinzentXenocorp, you want different code for the different (count num-seq)?
16:09TimMcWell, you can accept [x] and [x y], but you can't accept [x-of-2-elements] vs. [x-of-4-elements]
16:09TimMchmm, multimethods
16:09Vinzentor just (case (count num-seq) ...), actually
16:10Xenocorpah dammit, I forgot case. Having said that, in other languages I avoid case like the plague. Is it ok in Clojure?
16:10Xenocorpswitch statements...
16:10TimMcXenocorp: case is not switch
16:10Vinzentcase is ok
16:10XenocorpI'll re-read case docs then. Thanks
16:11Xenocorpis there a bot for getting clojure doc url?
16:11TimMc$cd case
16:11lazybotclojure.contrib.condition/handler-case: http://clojuredocs.org/v/64
16:11lazybotclojure.contrib.fcase/fcase: http://clojuredocs.org/v/298
16:11lazybotclojure.contrib.fcase/re-case: http://clojuredocs.org/v/299
16:11TimMcHmm... not quite.
16:16Vinzentso, what about having state in compile time between macro calls? Is it a good or a bad practice? Any ideas?
16:16TimMcSounds hinky. Do you have a compelling reason?
16:16sandy1986is there a websocket implementation for ring?
16:16sandy1986that will be a nice fit in the todo app
16:16geefare there any good static analysis toolsets targeting clojure?
16:19VinzentTimMc, I need to reify class which is known only in runtime. I can avoid it if I create a map with a factory functions, or if I'll save some state between my macro calls. Second sounds better, I think, but e.g. it put some restrictions on code's order
16:20Vinzentmaybe there is easier way to do it?
16:28chewbrancaahhh interesting, I recant my previous statement about hiccup not supporting extra attributes, he is using a macro to add extra attribute support to all elements at once. A much more elegant solution than the brute force approach I had in mind. I have much to learn about clojure
16:59AeroNotixhi
16:59AeroNotixI sorely want a decent book on clojure, any ideas?
16:59AeroNotixI've read Practical Clojure
17:00amalloyJoC
17:01AeroNotixI was expecting that
17:01AeroNotix:PO
17:02clj_newbdoes java swing/awt have a gui element which basically draws a rectangle + writes a piece of text around another element?
17:02clj_newbi.e. I have a text area -- I want it to have a border, and I wnat to put a label on top of it
17:02clj_newbI want to "frame" the component except I don't want a JFrame
17:02clj_newbdoes what I'm asking for make sense?
17:04AeroNotixah, that's called a frame
17:04pandeiroAeroNotix: you can "preview" JoC and CiA today, why don't you check both out before SOPA passes?
17:04clj_newbAeroNotix: what awt/swing component do I want?
17:04AeroNotixI don't use swing
17:04AeroNotixI use Qt
17:04clj_newbwith clojure?
17:04AeroNotixbut, you can use Qt.QtGui.QGroupBox (It's group box, I was confused)
17:05AeroNotixno, I use it with Python, but there's a Java implementation called Jamba that people have had success with
17:06AeroNotixSo SOPA is going to pass 100%
17:06AeroNotix?
17:06amalloythat's not a frame. you want a panel
17:07amalloy$google jpanel border
17:07lazybot[How to Use Borders (The Java™ Tutorials > Creating a GUI With ...] http://docs.oracle.com/javase/tutorial/uiswing/components/border.html
17:07AeroNotixI'll get you a pic
17:07AeroNotixhttp://imgur.com/YyncW
17:09clj_newbwhoa; too helpful
17:09clj_newbcan you guys do my taxes too?
17:10AeroNotixpandeiro: Did you mean that I would have had to go to the bay of pirates to preview those books?
17:17duck1123Assuming it's within your means, I'm sure the authors of those fine books would prefer if you got a copy from their website
17:20technomancy=\
17:25TimMctechnomancy: Mailing list?
17:25technomancyyup
17:26AeroNotixanyone feeling up for critiquing some code/
17:26AeroNotix?
17:26AeroNotixhttp://pastebin.com/PUmZ6qJP
17:27AeroNotixduck1123: I always buy the books I want
17:27bobhopeHas anyone been doing much with fork/join in clojure? I just wrote a very simple function to allow clojure functions to be trivially transformed into fork/join tasks
17:28TimMcAeroNotix: You can't run it with negative numbers.
17:28AeroNotixTimMc: That's interesting. Thanks.
17:29AeroNotixTimMc: Runs with them for me?
17:29TimMcAeroNotix: (my-max [-4 -5]) => 0
17:30AeroNotixah, I am running it with a quoted form
17:30TimMc?
17:30AeroNotix(my-max '(-99 -11 -44 1 44))
17:30AeroNotixI'm not 100% with the lingo
17:30TimMcDoesn't matter.
17:31TimMcIf all the numbers are negative, your function returns zero.
17:31AeroNotixohh all negative
17:31AeroNotixit does indeed. I see why
17:31brett_hreiddraper: https://github.com/reiddraper/sumo/pull/7
17:32amalloythe root issue, i think, is that max is not a total function on lists of numbers: it can't return a result for the empty sequence
17:32AeroNotixIsn't it that i'm setting champion to zero?
17:32AeroNotixat the beginning, so all negatives are losing?
17:33amalloythat's a symptom of the root issue (/me seems to be getting philosophical)
17:33AeroNotixheh.. :)
17:33amalloythe right answer is to init champion to the first element in the list
17:33AeroNotixahh
17:33AeroNotixI tried with nil but it seems clojure sees nil as devoid of value
17:33amalloybut you can't always do that, because of the root issue
17:33AeroNotixI see
17:34AeroNotixI see
17:34amalloyyou can start it with Double/NEGATIVE_INFINITY, which would sorta work
17:34amalloy(and is a common solution to this sort of problem)
17:35amalloybut you're still punting on how to handle an empty list. is it really reasonable for (my-max) to return Double/NEGATIVE_INFINITY?
17:36amalloy&(max)
17:36lazybotclojure.lang.ArityException: Wrong number of args (0) passed to: core$max
17:38AeroNotixhmm, I'm gonna play around....
17:38AeroNotixthis is for a 4clojure thing
17:39AeroNotixwhen I call it as (my-max [] ) I get nil. That's correct, no?
17:39amalloywhat is correct? what is the largest element in an empty sequence? the right answer is "you asked the wrong question, dude"
17:40AeroNotixForgive me for being blunt but, are you high?
17:40amalloyhahaha
17:40amalloyno
17:40AeroNotix:P
17:41amalloyi'm saying you're trying to solve a problem that can't be solved. it is impossible to find the largest element in an empty sequence. just throw an exception like clojure.core/max does
17:41technomancythe correct answer is 無
17:41AeroNotixoh right ok. Thanks. Pass the bowl, man.
17:41technomancyhttp://en.wikipedia.org/wiki/Mu_(negative)
17:41AeroNotixI understand now. I didn't know max threw an error when (= (empty? []) true)
17:42amalloy
17:43amalloyman, unicode has all kinds of crazy stuff
17:43AeroNotixI once saw dead people in Unicode
17:46bobhopeis apply fast in clojure?
17:46bobhopeor is it much faster to use a macro
17:46amalloyi find it hard to conceive of a case where "apply" and "use a macro" are two equivalent solutions to a problem
17:47bobhopeso, i am writing a simple binding to fork/join
17:47bobhopelet me post it on pastebin
17:47bobhopehttp://pastebin.com/M0Hpp2ST
17:48bobhopeI could make apply-fork a macro or a function
17:48bobhopeit's important for it to be as fast as possible
17:49bobhopeso I could do "`(.fork (mk-task ~the-fn ~@args))", or I could do what I already have
17:49bobhopeand a similar situation in mk-task
17:50bobhopesince if I can minimize the fork/join task creation overhead, I'll get much better performance and can use finer granulatiy
17:50technomancyare people trying out the new clj-stacktrace-aware swank?
17:51amalloyi mean, if apply-fork is always going to be a literal in your source code, with its args right there in front of it, then you can make it a macro, and it will obviously be faster by a non-zero amount
17:52bobhopemy goal is to make it as easy as possible to rewrite divide-and-conquer code that exists to use fork/join
17:52bobhopewithout thinking about it much
17:52amalloybut (a) you'll be limiting how apply-fork can be used, and (b) the gain will be like *nothing*
17:52brett_htechnomancy: is that a branch?
17:52technomancybrett_h: it's version 1.3.4-SNAPSHOT
17:53technomancybrett_h: it's on the 1.3.x branch, but you should just use it from clojars unless you're fixing a bug or something
17:53amalloyi mean, you're surely forking because you have actual cpu work to be done. if "calling a single function" is your bottleneck, your tasks are way too small
17:53bobhopethat's one problem
17:53bobhopei'm going to be attempting to parallelize core.logic
17:53bobhopewhich is embaressingly parallel
17:53bobhopebut its tasks are tiny
17:54bobhopeand it's basically impossible to coarsen the tasks
17:54bobhopeso cutting out a 1ms overhead for dispatch could result in a 30% speedup
17:54bobhopeor ever a 100us overhead
17:55amalloyi doubt you'll get that much change, and also i would be surprised if everything core.logic needs to do is knowable at macro-expansion time
17:55brett_htechnomancy: is the plugin all I need still?
17:55brett_htechnomancy: http://pastebin.com/EGQmEpQt
17:55technomancybrett_h: should be; just be sure you don't have an older clj-stacktrace anywhere
17:55bobhopei'm going to just target the main branch points in the library
17:59brett_htechnomancy: cleaned up my old clj-stacktrace plugin but still pst-elem-str error on "lein swank"
17:59brett_hhmm
17:59technomancymust still be an old copy somewhere
18:01brett_htechnomancy: I don't know, maven repo would be fine, right? http://pastebin.com/mMABLKHq
18:01brett_hnothing anywhere else
18:02technomancycopies in ~/.m2 won't be put on the classpath unless :local-repo-classpath is set
18:02brett_hit's not
18:02brett_hno hackery, simple lein project
18:02technomancythe jars in ~/.lein/plugins are uberjars
18:03technomancyso one of them could contain an old clj-stacktrace
18:04brett_htechnomancy: that was it :) and wow, beautiful
18:04brett_h<3
18:05technomancydefinitely need to add that to the troubleshooting section before a release
18:06brett_htechnomancy: lein-difftest was the culprit in this case, if it helps for the notes
18:06technomancybrett_h: aha; well I'll be sure to cut a new release of that first.
18:06technomancythanks
18:08clj_newbi'm developing in the repl; I can't use reload-all since it forces some fiels which execute defstructs to be reloaded more than once. Is there someway I can say "reload everyfile exactly once" or "unload all *.clj files" ?
18:08clj_newbor somehow tell load-file "reload all dependencies"
18:09technomancybest thing is to probably stop using defstructs
18:09clj_newberrr, I mean defrecords
18:10clj_newbtypo
18:10clj_newbi'm developing in the repl; I can't use reload-all since it forces some fiels which execute defrecords to be reloaded more than once. Is there someway I can say "reload everyfile exactly once" or "unload all *.clj files" ?
18:10technomancytempted to say my advice still stands =)
18:12technomancyif you aren't using protocols you probably shouldn't use defrecord
18:14TimMctechnomancy: I'm often tempted to use defrecord because it allows me to centralize documentation of an associative data structure's format.
18:15amalloyclojurebot: Records (and, long ago, structs) |are| "advanced features", which can cause significant pain if you don't get all the subtleties. If you're using them to create "classes" because classes are awesome, then you are probably better off just using plain old hashmaps, possibly with a :type key if you want to be clear about what type they are.
18:15clojurebotIn Ordnung
18:17technomancyclojurebot: records and structs?
18:17clojurebotTitim gan éirí ort.
18:17technomancyclojurebot: (throw (InsufficientFuzzinessException.))
18:17clojurebotGabh mo leithscéal?
18:19clj_newbamalloy: ouch :-)
18:19amalloyclojurebot: Records?
18:19clojurebotPardon?
18:19amalloysigh
18:20brett_his there a debugger for clj 1.3+ ?
18:20TimMcclojurebot: clever bot
18:20clojurebot*flexes its talons while eyeing TimMc*
18:20amalloyclojurebot: Records |are| (and, long ago, structs were) "advanced features", which can cause significant pain if you don't get all the subtleties. If you're using them to create "classes" because classes are awesome, then you are probably better off just using plain old hashmaps, possibly with a :type key if you want to be clear about what type they are.
18:20clojurebotc'est bon!
18:20technomancyclojurebot needs replace-key and replace-value commands
18:20clj_newbamalloy: this is clear that Clojure has similar memory as me
18:21TimMctechnomancy: reusable preconditions... got a blog post on that?
18:21TimMcor any other expansion on the idea?
18:21clj_newbis there a way with clojure to get a list of all functions that match a given regexp?
18:22TimMcclj_newb: find-doc is pretty close
18:22technomancyTimMc: http://blog.fogus.me/2009/12/21/clojures-pre-and-post/ and JoC... maybe the trammel library
18:23technomancynot that I've used it; it's just where I would look if "I'm having a hard time keeping track of the keys needed for this specific map" ever became a problem for me.
18:23TimMcthanks
18:25TimMcI guess I'm not really worried about catching bugs so much as centralizing the documentation in a predictable place.
18:25technomancyI think if your preconditions are formalized in a def they can serve as documentation
18:25TimMcIf 2 namespaces all rely on a certain data structure, where does that knowledge live? :-)
18:26TimMcs/2/3/ whatever
18:26technomancyyou'd have that same problem with defrecord
18:26TimMcMaybe a macro (def-data-structure ...) that compiles to nil. :-P
18:27TimMcOh, with defrecord I create a new namespace and define it there.
18:27technomancy(defn valid-abc-map? [x] (every? x [:a :b :c])) ; is really all it takes
18:28TimMcIt's also easier if there is a well-defined set of operations to be performed on the data structure -- then those live in a namespace and there's a nice big comment at the top.
18:28technomancynone of that is specific to records
18:28TimMc*1 was in reference to the general case.
18:28clojurebotexcusez-moi
18:29technomancyhmm; another use case for rpartial. they don't happen as often as you'd think.
18:29AeroNotixtechnomancy: off-topic but, fave clojure book?
18:30TimMctechnomancy: rpartial?
18:30technomancyAeroNotix: I've only read the 1st edition of the Prags' and JoC. both worth reading; JoC is more fun.
18:30technomancyTimMc: partial, but from the right
18:30AeroNotixtechnomancy: thanks
18:31clj_newbalright
18:31clj_newbthis is probably the wrong way to solve this problem
18:31clj_newbbut is there a way to (1) get a list of all loaded *.clj fiels
18:31clj_newband (2) a way to mark fiels are unloaded (so they get reloaded)?
18:34technomancymaybe someone who actually likes records could suggest a better way to make them work with interactive development. =)
18:34TimMcclj_newb: Trying to write your own everything-reloader?
18:34TimMcThat might be nice.
18:34TimMcI wonder if it is possible.
18:37TimMcI guess as long as you don't hold on to instances of replaced classes you might be OK.
18:41clj_newbrecords have been causing me so much trouble
18:41clj_newbI really don't know why i';m not using maps
18:44technomancyabout to release swank 1.3.4; speak now or hold much peace &c.
18:46amalloyclj_newb: good news, clojurebot has a suggestion for you in that case
18:46amalloyif he managed to remember it this time
18:47clj_newbamalloy: what should I ask clojurebot?
18:47amalloy~records
18:47clojurebotRecords are (and, long ago, structs were) "advanced features", which can cause significant pain if you don't get all the subtleties. If you're using them to create "classes" because classes are awesome, then you are probably better off just using plain old hashmaps, possibly with a :type key if you want to be clear about what type they are.
18:47amalloyjust referring back to that, is all
18:48clj_newbamalloy: I feel Like I will be a better clojure programmer if I listen to your advice more often.
18:48technomancyalternative approach is to just mine clojurebot's factoid database
18:49technomancyyou will either go insane or emerge victorious.
18:49technomancyor both?
18:49clj_newbha
18:50clj_newbI wrestled with defrecord
18:50clj_newband I have won
18:50clj_newbdefrecord is now hiding underground and will screw up my code on a later date.
18:51bobhopeIs there a reason that some people wrap every java interface with a new protocol and then extend-type the java interface instead of just wrapping the methods with defns?
18:52bobhopes/java interface/java class/
18:57rata_hi
19:08alexbaranoskyAnyone know of another way to use `some` than as a predicate? It returns true of nil
19:13rata_alexbaranosky: what do you mean?
19:13alexbaranoskyrata_, nothing now :) I didn't realize that some returned the first truthy value
19:13rata_ok
19:16rata_LauJensen: are you there?
19:30alexbaranoskywe've got a `symbol?`, `keyword?`, `class?`, `string?` etc ... how about a `named?`
19:59gnnr_What's the best way to set class path for a new project? I have read a lot of documentation, but still can't seem to get clojure to recognize class path
19:59gnnr_Thanks for any help
20:09technomancygnnr_: you shouldn't set the classpath
20:12technomancyweavejester: FYI: https://github.com/heroku/heroku-buildpack-clojure/issues/10
20:13weavejestertechnomancy: Aha, awesome :)
20:13weavejestertechnomancy: Well, when it's fixed it will be at least :)
20:14technomancyweavejester: yeah, I think I may decompose plugins into their own dependency listing in lein 1.6.3 rather than waiting for 2.0.
20:14technomancydepending on how painful that is to implement without pomegranate =\
20:14technomancyany thoughts on that?
20:15weavejestertechnomancy: I'd really like that.
20:15weavejestertechnomancy: Although I wonder whether that shouldn't be 1.7.0 instead of 1.6.3
20:16weavejesterSemantic versioning and all.
20:16technomancyyeah, totes
20:16gnnr_yea I'm trying to configure swank, and slime, neat that you responded here
20:17technomancygnnr_: are you having trouble with the instructions here? https://github.com/technomancy/swank-clojure/
20:18choffsteinHey all :) Quick question: I am calling reduce over a transient map and my function is calling (and only calling) assoc!. I keep getting a OutOfMemoryError -- which makes no sense to me, since I thought assoc! would be in place. Any ideas? (I can post a gist if necessary)
20:19gnnr_oh great, thank you so much. I will go through this carefully
20:19technomancygnnr_: if you can leave a comment on whatever old instructions you were using earlier mentioning that they're badly out of date, that would be super too. =)
20:20gnnr_sure
20:20choffsteinhttps://gist.github.com/1525702
20:22amalloychoffstein: well, i have to say it seems a little weird that you can't hold two million objects on your heap, but your code looks fine
20:22choffsteinamalloy: Well, I am just doing the clojure repl, so that may be why?
20:23amalloyfor given values of fine; really all you've done is reinvent (into {} (for [k (range 1 1e6)] [k (* 2 k)]))
20:23technomancydefault heap on client jvms is pretty small
20:23choffsteinRight. I know. I was just seeing if transients were faster than into :)
20:23choffsteinunless … into uses transients?
20:23technomancybut yeah... maybe if a bunch of other stuff was loaded
20:23amalloygive the man a cigar
20:23technomancychoffstein: it does
20:24choffsteinof course it does
20:24amalloyand fwiw, your code runs fine for me, as has other code with larger maps
20:24amalloyer.....except i tried running my code, not yours. let's try again
20:25amalloywhew. yours also works fine
20:25choffsteinhaha. okay. thanks :)
20:25choffsteinit just seemed strange to me that I could do a (def ks (doall (range 1 1e6))) -- but for some reason, ran out of memory doing, what seemed like, im memory updates
20:25kenthwhy does some functions require #' in (meta #'func) while some do not?
20:26TimMckenth: Some are macros.
20:26choffsteinwhoops -- gotta run. later everyone
20:27TimMckenth: A macro can wrap the name in (var ...)
20:28TimMckenth: For example, the expansion of (doc ...) includes (meta (var ~name))
20:29kenththat makes sense, thanks
20:33TimMcdoc is purely a REPL utility, so it goes for maximum ease-of-use and least flexibility. :-)
20:34TimMcand meta is intended for use on *anything* with metadata, not just vars.
20:34TimMckenth: Oh, and #'foo is just sugar for (var foo), in case that wasn't clear.
20:36gf3hola, must be having a noob issue here, how do I compose java.lang.* functions?
20:36devnl
20:36gf3e.g. Math/sqrt
20:37devngf3: could you post a failing example?
20:37TimMcgf3: They're methods, not functions. :-/
20:38gf3devn: just playing around with something like: ((comp list int Math/sqrt) 25)
20:38devn,((comp list int Math/sqrt) 25)
20:38clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: sqrt in class java.lang.Math, compiling:(NO_SOURCE_PATH:0)>
20:38devn,(import java.lang.Math)
20:38clojurebotjava.lang.Math
20:38devn,((comp list int Math/sqrt) 25)
20:38clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: sqrt in class java.lang.Math, compiling:(NO_SOURCE_PATH:0)>
20:39TimMcdevn: It's not a function!
20:39devn:\
20:39TimMchaha
20:39devnI use that one a lot. Thankfully you haven't heard it before.
20:39TimMcgf3: Short answer, #(Math/sqrt %) is a function you can use.
20:40gf3TimMc: I suppose it's just confusing as it appears to work like a function: (Math/sqrt 25)
20:40TimMcyep
20:40gf3TimMc: vs (.sqrt 25) or something
20:40TimMcConvenient but misleading.
20:41gf3TimMc: thank you
20:41mrb_bkIf someone has work in a Github repo that's more recent than what's on clojars, what's the best way to include the latest work in a project
20:41TimMc&(. java.lang.Math sqrt 5) ; gf3
20:41lazybot⇒ 2.23606797749979
20:41TimMc^ that's the fully expanded form
20:41gf3TimMc: ahh
20:41TimMcwhere . is a special form for Java interop
20:42TimMcmrb_bk: You can use a lein checkout dep
20:42TimMcKeep the dependency in your project.clj, but create a checkouts folder and symlink checked-out projects into it.
20:43mrb_bkah awesome
20:43mrb_bkTimMc: what about the version number?
20:43TimMcHmm, dunno!
20:44TimMcMaybe it is ignored.
20:45mrb_bkawesome
20:45mrb_bkit does "Copying 3 files to..."
20:47mrb_bkTimMc: thanks!
20:47TimMcNo problem!
20:47TimMcmrb_bk: Leiningen has all sorts of cool tricks. The README has some good stuff, but also look at the sample project.clj.
20:48mrb_bkTimMc: one more noobish thing that annoys me -- I'm working with a SLIME like setup with vim and a lein repl -- I use "lein repl" in the root of my project dir. Isn't that supposed to pick up all of my project files?
20:49TimMcNot sure what that last sentence meant.
20:49TimMcIt's supposed to arrange the classpath, start a REPL, and optionally select your main namespace.
20:55devnwow. i haven't read anything even remotely related to programming in over 4 days.
20:57TimMcdevn: http://blogs.tedneward.com/2006/06/26/The+Vietnam+Of+Computer+Science.aspx
20:57TimMcunless you're going for a record
20:57devnTimMc: not at all. just hopping back into the saddle tonight.
20:57devni needed a few days of food, sleep, and annoying conversations about politics to get me back into the swing of things ;)
20:59devnTimMc: i already am interested. :)
21:01devnTimMc: i've done a fair bit of study on vietnam, so the scare factor of this article already has me firmly within its grip
21:01devnpun intended
21:02TimMcdevn: Good, let me know if the author is talking out of his ass on that bit.
21:09mrb_bkTimMc: Ah yes I guess I was talking about selecting my main namespace
21:11devnHe never mentions Ho Chi Minh which is sort of surprising IMO
21:12devnTimMc: the analogy seems tied to a particular reading or two. That's not saying it misrepresents, but it is surely a wild analogy
21:17devnTimMc: He misses a lot of boats when talking about Kennedy, Johnson, the reasons behind their decisions, etc.
21:17devnIt just doesn't work on the level he's trying to apply it unless you accept a fuzzy definition of the history of Vietnam
21:18choffsteinIs there an available alternative to http-agents for 1.3?
22:07romanandregis anyone here experienced doing leiningen plugins? :-)
22:15romanandregI've inferred so far that, if I want to be able to use the leiningen API (have it in the classpath) I need to set the evan-in-leiningen flag to true in the project.clj of the leiningen plugin project, however, when I do that the version of the clojure running on repl becomes 1.2.1, is there anyway to use 1.3, and have the leiningen library on the class path?
22:20amalloyi believe the answer to that is no. leiningen and its libraries are on 1.2
22:22romanandregamalloy: uhmm I'm trying to implement a small plugin to run clojure.test.generative tests, however that library requires 1.3, that being the case, I cannot implement a plugin for leiningen then?
22:22amalloy*shrug* not a lein expert by any means
22:24romanandregamalloy: uhmm… I have been all afternoon trying to make this work :-(, I've learned tons though it's a pretty frustrating process not getting any victories so far
22:24romanandregtechnomancy: whenever you have chance, pls check this questions I made before, I know is likely you could help me here, but I guess you are not around..
22:25jackhammer2022http://k.timmc.org:7013/ try ClojureScript
22:42romanandregjebberjeb: by any chance if you have the ePub and an iPad try this app called readmill, I'm leaving a lot of comments about this book there => http://readmill.com/books/the-joy-of-clojure-thinking-the-clojure-way
22:43jebberjebromanandreg: I do have the ePub, but I've got an android tab -- maybe they've got the app too
22:43romanandregjebberjeb: I really hope they do, the app is pretty great, and to share highlights and comment is pretty great
22:44jebberjebcool, thanks for the tip
23:24technomancyromanandreg: it sounds like you basically want to use the same approach as leiningen.test
23:24technomancyyou need :eval-in-leiningen, and then the code that runs in the context of the project needs to use leiningen.compile/eval-in-project
23:25romanandregtechnomancy: yes, I tried exactly that
23:25romanandregtechnomancy: however, when doing :eval-in-leiningen I get clojure 1.2.1, and test.generative requires 1.3, they are using some defs with meta-data flags that are not valid in 1.2)
23:25technomancyright
23:25technomancybecause you don't use test.generative in leiningen
23:26technomancyyou use it in the project
23:26romanandregtechnomancy: I guess… I wanted to do a task to run generative tests though :-s
23:26technomancyright
23:26technomancynotice that leiningen.test does not require clojure.test, it just calls eval-in-project on a form that contains (require '~'clojure.test)
23:26romanandreguhmm
23:28romanandregtechnomancy: so I might just try that and come back to you, I won't require test.generative on the same context as the leiningen task
23:28romanandregas long as it is on the import block of the eval-in-project
23:28romanandregeverything should be good right?
23:29technomancythat's right
23:29technomancysomething like this: http://p.hagelb.org/test-generative.html
23:29technomancy(except I have no idea how test.generative works)
23:30technomancyit's really a shortcoming of the plugin guide that it doesn't cover this
23:31romanandregtechnomancy: thanks! where is this plugin guide by the way… I've been able to learn all about plugin development by actually reading code :-)
23:31romanandregI guide would be really helpful for sure
23:31technomancyromanandreg: it's in doc/PLUGINS.md
23:31romanandreguhmm
23:31romanandregI looked it up in the wiki
23:32technomancyyeah, the wiki isn't really used for official docs
23:32technomancyI'll add a note to the wiki home
23:33romanandregtechnomancy: I was going to suggest that :-)
23:34romanandregtechnomancy: thanks for the feedback, I'll get back to you tomorrow, probably everything is gonna work...
23:34technomancysure. there's also the #leiningen channel.