#clojure logs

2011-06-22

00:41sunniboquestion: is there any well-formed URL checking lib? i don't want to check if the URL is valid or not. i just want to check if the given string is a URL or not.
00:46amalloysunnibo: uhhh, the thing you want to do and the thing you don't want to do seem to be the same thing. http://www.someurlimadeup.com isn't "invalid" just because nobody owns that domain name
00:47amalloybut i think ##(java.net.URL. "http://whatever.com") will work, by throwing an exception if it's invalid
00:47sexpbot⟹ #<URL http://whatever.com&gt;
00:48amalloy&(java.net.URL. "test")
00:48sexpbotjava.net.MalformedURLException: no protocol: test
00:52sunnibothanks, amalloy
02:01sunniboquestion: how can i get a number from a string? the given string is an alphanumeric. i want to get the number part. ex) "123'" -> 123
02:06amalloy$findfn "123" 123
02:06sexpbot[clojure.core/read-string clojure.core/bigdec clojure.core/bigint]
02:07Scriptor,(doc read-string)
02:07clojurebot"([s]); Reads one object from the string s"
02:07Scriptor,(read-string "123")
02:07clojurebot123
02:07Scriptor,(read-string "123'")
02:07clojurebot123
02:07Scriptorsunnibo: looks liek that's what you want
02:07Scriptor*like
02:22rhdoengessunnibo: or (Integer. "123")
02:22rhdoenges,(Integer. "123)
02:22clojurebotEOF while reading string
02:22rhdoenges,(Integer. "123")
02:22clojurebot123
02:22rhdoenges,(Number. "123")
02:22clojurebotjava.lang.IllegalArgumentException: No matching ctor found for class java.lang.Number
02:22rhdoengesohkay.
02:22rhdoengesso you want Integer probably
02:24rhdoengesbecause this can happen:
02:24rhdoenges,(read-string "(1 2 3 4 5)")
02:24clojurebot(1 2 3 4 5)
02:25Scriptorah, right, read as in clojure's reader
02:30teromInteger(String s) constructs a new Integer object; in case that matters, you can use also Integer#parseInt(String s).
02:30terom,(Integer/parseInt "123")
02:30clojurebot123
02:32Scriptorterom: parseInt doesn't work when there are non-numeric characters, and that's what sunnibo needed
02:32Scriptor,(Integer/parseint "123'")
02:32clojurebotjava.lang.IllegalArgumentException: No matching method: parseint
02:32Scriptor,(Integer/parseInt "123'")
02:32clojurebotjava.lang.NumberFormatException: For input string: "123'"
02:32terom,(Integer. "123'")
02:32clojurebotjava.lang.NumberFormatException: For input string: "123'"
02:33teromScriptor: true, and neither does Integer constructor.
02:33Scriptoryep, so I guess you'd have to rely on read-str, although if there's valid clojure code in the string there'd be problems
02:34teromWell, one could also use regexps. Depends on the input strings, really.
02:36rhdoenges(read-str "123") is prettier. Just be sure that you are passing safe input and you're fine.
02:38rhdoenges*read-string
02:38rhdoenges:P
02:39Scriptor,(read-string "2 a")
02:39clojurebot2
02:39Scriptor,(read-string "2 :a")
02:39clojurebot2
02:40sunniboread-string would be good for me. thanks, guys!
02:40Scriptorsunnibo: careful if you do something like (read-string "a 2")
02:40Scriptor,(read-string "a 2")
02:40clojurebota
02:41Scriptoras you can see, it seems to go for the first token
02:42ScriptorI guess if you need to you could always do a string replace of anything that's not a digit with blak
02:46amalloy&(->> "a 123" (re-seq #"\d+") first read-string)
02:46sexpbot⟹ 123
03:23sunniboanother question: ((1 2 3) (4 5) (6 7)) -> (1 2 3 4 5 6 7)
03:25raeksunnibo: ##(apply concat '((1 2 3) (4 5) (6 7)))
03:25sexpbot⟹ (1 2 3 4 5 6 7)
03:26raek,(apply concat '((1 2 3 (4 5)) (6 7)))
03:26clojurebot(1 2 3 (4 5) 6 7)
03:26raek,(flatten '((1 2 3 (4 5)) (6 7)))
03:26clojurebot(1 2 3 4 5 6 7)
03:27raek"apply concat" does not have a shorter name unfortunately
03:30raekand "flatten" is not in general a substitute
03:30sunniboraek, thanks
03:49RaynesI propose that concat be renamed to octocat.
03:51rhdoengesI propose that github does all my programming and I eat calamari.
03:54sunnibo,(and '(false false))
03:54clojurebot(false false)
03:55sunnibo,(and '(false true))
03:55clojurebot(false true)
03:55__name__,(apply and '(false false))
03:55clojurebotjava.lang.Exception: Can't take value of a macro: #'clojure.core/and
03:55sunnibohow can i get just 'false'?
03:55raek,(every? identity '(false false))
03:55clojurebotfalse
03:56sunnibo,(every? identity '(false true))
03:56clojurebotfalse
03:56raek,(and :truthy :falsy)
03:56clojurebot:falsy
03:56raek,(boolean (and :truthy :falsy))
03:56clojurebottrue
03:56sunnibo,(some identity '(false true))
03:56clojurebottrue
03:56sunniboyeah, but the parameter is a list
03:57raekeh, ":falsy" is of course truthy since it's neither nil nor false...
03:57__name__(every? true? [true false])
03:57__name__,(every? true? [true false])
03:57clojurebotfalse
03:57__name__,(every? true? [false false])
03:57clojurebotfalse
03:57__name__,(every? true? [false true])
03:57clojurebotfalse
03:57raek,(every? true? [1 2])
03:57clojurebotfalse
03:57__name__,(every? true? [true true])
03:57clojurebottrue
03:57raek,(every? identity [1 2])
03:57clojurebottrue
03:57sunnibowhat's the 'identity
03:58raeksunnibo: the identity function just returns its argument
03:58raekso the value itself is checked for truthiness
03:59sunnibo,(identity '(false true))
03:59clojurebot(false true)
03:59sunniboi got it
03:59rhdoenges,(doc and)
03:59clojurebot"([] [x] [x & next]); Evaluates exprs one at a time, from left to right. If a form returns logical false (nil or false), and returns that value and doesn't evaluate any of the other expressions, otherwise it returns the value of the last expr. (and) returns true."
03:59raek,(every? identity [a b c]) is equivalent to (boolean (and (identity a) (identity b) (identity c)))) which is equivalent to (boolean (and a b c))
03:59clojurebotjava.lang.Exception: Unable to resolve symbol: a in this context
04:24sunniboquestion: i have a couple of lists, (1 2 3) (a b c) (u v s). how can i get (1 a u) (2 b v) (3 c s)?
04:27Fossi,(find)
04:27clojurebotjava.lang.IllegalArgumentException: Wrong number of args (0) passed to: core$find
04:31Scriptorsunnibo: look into map, specifically passing it multiple lists
04:31Scriptorcheck out the examples: http://clojuredocs.org/clojure_core/clojure.core/map
04:36sunnibo,(map list '(1 2 3) '(a b c) '(u v s))
04:36clojurebot((1 a u) (2 b v) (3 c s))
04:39Cozeywoo - lisp syntax is gaining popularity: http://programming.nu/
04:42Fossiweird
05:33pyrnoir is really well polished
06:19Cozeyhow could i define a multimethod dispatch function, so it accepts a _set_ of values per each defmulti ?
06:20bsteuberCozey: you can't using defmulti
06:20bsteuberbut you can do that yourself
06:21bsteuberhave one lookup function
06:21bsteuberand one facade function doing the dispatch
06:23clgvCozey: I am not sure if I understood you completely - can you give an example of what you mean?
06:24Cozeywell
06:25Cozey(defmulti foo (fn [some-text value] some-text))
06:26Cozey(defmethod #{"zebra" "horse"} [_ v] (run-away v))
06:26Cozey(defmethod #{"fox"} [_ v] (hide v))
06:26Cozeysomething like this
06:26jhuni,(+ 1 1)
06:26clojurebot2
06:27clgvah ok
06:28jhuni,(-> 0 inc inc)
06:28clojurebot2
06:29clgvCozey: you could implement bsteuber suggestion then or build an own macro that translates your "set defmethod" into single standard defmethods.
06:33Cozeyhmm - lookup, disptach - which one is on defmulti and wher is the other one ?
06:33clgvCozey: defmethod and defmulti almost instantly use the java part of the clojure implementation. so you cant just alter them easily
06:36Cozeyclgv: generating few methods is not a bad idea
06:39Cozeyand in bsteuber's idea, how would that look ? defmethod always matches it's arguments with = right?
06:41Cozeyhmm. but from extensibility perspective, generating a defmethod for each set element is better
06:44bsteuberCozey: true, so maybe it's simplest
06:44bsteuberto just have a macro define a method per key
06:45manuttercan you use hierarchies for that?
06:46clgvCozey: you could try something like that: (defmacro defmethod-set [name value & body] (if-not (set? value) `(defmethod ~name ~value ~@body) `(doseq [v# ~value] (defmethod ~name v# ~@body))))
06:46clgvI tried it for a simple value and a set
06:46clgv(defmethod-set foo #{"donkey", "horse"} [bla v] "donkey or horse")
06:46clgv(defmethod-set foo "zebra" [bla v] "zebra")
06:47Cozeyyes - unfortunately in my example i dispatch on two values - from which only one is intended to be a set - but a general solution would create a cartesian product of both sets (it they were sets) and generate defmethods for this
06:47clgvit get's the job done, but it will define multiple implementations - one for each dispatch value.
06:48Cozeys/example/project/
06:48sexpbot<Cozey> yes - unfortunately in my project i dispatch on two values - from which only one is intended to be a set - but a general solution would create a cartesian product of both sets (it they were sets) and generate defmethods for this
06:48Cozeysexpbot: thanks :-)
06:48clgvhmm you can also skip the if-not and only use defmethod for value dispatch and defmethod-set for set dispatch
06:50Cozeyyes
06:51clgvhmm you could also use the original defmethod only and built some sort of pre-dispatch into the dispatch function
06:52Cozeyit's not possible to add a docstring to defmulti ?
06:52Cozey"The syntax for defmulti has changed. Example: (defmulti name dispatch-fn :default dispatch-value)"
06:53clgv(defmulti foo (fn [some-text value] (cond (#{"donkey" "horse"} some-text) :donkey-or-horse (= "zebra" some-text) :zebra :else :default)))
06:53clgvand then use the keywords in your defmethods
06:53Cozeyuh my bad - it's ok
06:54clgvI think thats really elegant that way
06:54Cozeyclgv: yes i thought about this too - but then it would not be possible to add new types - and that is what defmulti is all about
06:54clgvhumm can you use a multimethod as dispatch function? ;)
06:54Cozeyso the previous idea is better, because in the end we get a 'compatible' solution, typing less.
06:55Cozeybrialiant!
06:55clgvbut still quite a bit of a hack ;)
06:56Cozeyor maybe i could use a hierarchy ?
06:56Cozeybut can i use strings in hierarchies ?
06:56bsteuberno, only namespace-qualified keywords are allowed in hierarchies
06:56bsteuberand java classes as leaves
06:58clgvis there a clojure construct called "hierarchy"?
06:59Cozeyi could convert the strings into keyword
06:59Cozeyhttp://clojure.org/multimethods
06:59clgvjust got there through google ;)
07:00Cozeyhow to create a ::kw keyword ?
07:00Cozeybound to a namespace?
07:01Cozey,(keyword *ns* "pe")
07:01clojurebotjava.lang.ClassCastException: clojure.lang.Namespace cannot be cast to java.lang.String
07:01clgvCozey: keywords are not really bound to namespaces - if you add :: in front it just adds the namespace as prefix to the keyword
07:01Cozey,(doc keyword)
07:01clojurebot"([name] [ns name]); Returns a Keyword with the given namespace and name. Do not use : in the keyword strings, it will be added automatically."
07:01Cozeybut how to run second form of keyword
07:02terom,(keyword "ns" "keyword")
07:02clojurebot:ns/keyword
07:02clgv&(keyword (name *ns*) "pe")
07:02sexpbotjava.lang.ClassCastException: clojure.lang.Namespace cannot be cast to clojure.lang.Named
07:02clgv&(keyword (ns-name *ns*) "pe")
07:02sexpbotjava.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.String
07:02bsteuberhaha
07:02bsteubercloser
07:02terom,(keyword (str *ns*) "pe")
07:02clojurebot:sandbox/pe
07:02bsteuberbut using *ns* doesn't make sense anyways
07:03Cozeywhy?
07:03clojurebothttp://clojure.org/rationale
07:03bsteuber,::pe
07:03clojurebot:sandbox/pe
07:03bsteuberbecause :: is shorter
07:03clgvbsteuber: he wants to generate keywords from strings ;)
07:04bsteuberdamn :)
07:04bsteuberbut I don't think a hierarchy will gain so much
07:04bsteuberbecause if you want to define many at once
07:04bsteuberyou still need to generate all the derive-statements
07:05Cozeyyes but it's shorter and extensible
07:06Cozeywhen I think of it now, it's a perfect match for this use case
07:06clgvyou can always write a wrapper macro or function ;)
07:07clgvCozey: so your dsipatch function will always got to the highest parent in the hierachy and return that one?
07:08Cozeyclgv: there's this isa? thing which is used automatically
07:09Cozeyi'll get it to work and show
07:10clgvCozey: can't imagine a dynamic version with 'isa? but I'll wait and see^^
07:10Cozeythe isa? should be automatic
07:10Cozeyhere are examples : http://clojuredocs.org/clojure_core/1.2.0/clojure.core/defmulti
07:11clgvit's transitive for sure but I dont know how you want to write your dispatch function with it
07:14clgvah. defmultia uses 'isa? instead of '=
07:28Cozey*ns* yields <user> when required from user, even if the function is in another ns
07:28Cozeyshoudl i harcode it like "foo.bar" or ?
07:36teromI'm not sure what you're doing (maybe you should paste your code somewhere), but maybe this could help: ##(read-string "::pe")
07:36sexpbot⟹ :sandbox7608/pe
07:38clgvCozey: thats expected behavior. *ns* returns the *ns* you are in. you might want to use ~*ns* within a macro
07:39Cozeymhm
07:39clgvCozey: or you show us the example, what it does and tell us what it is intended to do ;)
07:40Cozeyone sec:
07:40Cozeyhttps://github.com/lolownia/lancet/blob/master/src/lancet/core.clj#L58
07:42Cozeythat way i can write ant-tasks under lein using more idiomatic clojure: https://gist.github.com/1039929
07:43clgvso now the exact call and its output are needed ;)
07:44Cozey?
07:45Cozey(add-nested "exec" (ExecTask. .... ) "--help") will set --help argument on ExecTask
07:46Cozeyon the other hand (add-nested "war" (War. ...) (FileSet. ... ) ) will set filesets for Warfile to use. Ant has a bizzare API - that is: lot's of tasks use different input objects
07:46clgvhumm I dont even see any usage of *ns* in there
07:46Cozeylike ManifestTask for generating Manifest files - they use Manifest$Attribute
07:46Cozeyi have hardcoded lancet.core
07:47Cozeyline 68
07:47Cozeynot the best solution out there
07:51Cozeyenough. I'm going outside :-) thanks for help and have a nice day.
07:52clgv*ns* should work in there as well
08:14clgvconcerning maps where is the difference between 'into and 'merge? which one should I prefer to use?
08:15clgv(doc into)
08:15clojurebot"([to from]); Returns a new coll consisting of to-coll with all of the items of from-coll conjoined."
08:15clgvok merge supports multiple maps
08:17bsteuberinto also works for other types
08:18clgvyes, it's more general.
09:01shtutgartIn Midje, I've wrote (provided (get @an-atom anything) => :foo) and got "You claimed the following was needed, but it was never used: (get (clojure.core/deref an-atom) anything)". What might be the problem?
09:02shtutgart(of course I'm calling get on @an-atom)
09:17manuttershtutgart: I wonder if it would make a difference if you wrote out (deref an-atom) instead of using the shortcut @an-atom
09:23raek,(read-string "@foo")
09:23clojurebot(clojure.core/deref foo)
09:24raekthat seems unlikely. there shouldn't be any difference from the forms emitted by the reader. (except for the namespace qualification of the symbol, maybe)
09:34pyrhi
09:34pyris it a known bug that (keyword "") breaks the code is data / data is code aspect of clojure
09:35pyr,(read-string (str {(keyword "") :foo}))
09:35clojurebotjava.lang.RuntimeException: java.lang.Exception: Invalid token: :
09:39jochen_hi, I have an enlive question: in swadonnette tutorial scrape2.clj, select with a set as second par is used to extract two items, but then partition2 with vector destructuring is used to assign to headline and points. Isn't this broken as a set does not guarantee any order?
09:39cemerickpyr: Not broken. Empty keywords just aren't readably printable.
09:41pyrit looks as if LispReader.java could be coerced into getting it right
09:42pyrcemerick: ok, but that breaks homoiconicity at least
09:42cemerickpyr: A saner approach (often-suggested) is to support arbitrary symbols and keywords via pipes. e.g. :|| for an empty keyword, or |foo bar| for a symbol with spaces, etc.
09:43cemerickpyr: how? You're just bumping up against impl details of the reader.
09:45pyrwell even if its not that important if it can be cleanly fixed in the reader it's just all for the better isn't it ?
09:47cemerickpyr: the empty keyword is just one edge case, along with keywords and symbols with constituent whitespace, colons, and slashes. "Fixing" the reader to handle just one of them isn't seen as a high priority, when there's likely an acceptable general-purpose solution.
09:48clgvpyr you can also do that: ##(keyword ":bla")
09:48sexpbot⟹ ::bla
09:48pyrcemerick: 'k, got it
09:49cemerickpyr: If it's a big concern/problem for you, do feel free to take it on. My guess is that particular behaviour hasn't changed because no one has cared enough to push on it.
09:49pyrcemerick: nope, i didn't get that there were so many other non readable forms
09:50pyrcemerick: and indeed it doesn't make sense to fix just the one
09:50pyrit's true that i could have just tried ##(keyword " ")
09:50sexpbot⟹ :
09:51pyrto see for myself :)
09:52clgvbut I guess this one doesnt read-in like it should as well: ##(-> (keyword ":bla") str read-string)
09:52sexpbot⟹ :sandbox7608/bla
09:53clgvit's discouraged in some doc to generate keywords like that but not impossible.
10:10TimMc,(identical? :f (keyword "f"))
10:10clojurebottrue
10:10TimMcgood
10:17clgv&(identical? ::bla (keyword ":bla"))
10:17sexpbot⟹ false
10:17clgv;)
10:34TimMceep
10:35TimMcOh, I see.
10:51clgvsexpbot: would you like to join #clojure.de? ;)
10:51sexpbotI'd do him. Hard.
11:03ejacksonfilthy bot - i hope you practice safe hex.
11:16miltondsilvahi, you all know this http://cemerick.com/2011/06/15/the-2011-state-of-clojure-survey-is-open/ so, in the comments section Chas Emerick says that a different survey covering other type of questions could be useful...
11:17miltondsilvahere is a draft of a possible survey
11:17miltondsilvahttps://spreadsheets.google.com/spreadsheet/viewform?formkey=dFFJTTZWT2lXR1N1dTJTWk5mdjZXZlE6MQ
11:18miltondsilvasugestions are very welcome (to add more questions or to add more options, I'm sure there are missing ones)
11:54justinlillyHey folks. What's the preferred cheap/free hosting setup for a clojure webapp? AppEngine?
11:54justinlillydidn't know if there is a heroku-like equivalent in the JVM world.
11:54dnolenjustinlilly: Clojure runs on Heroku
11:55wastrelnever heard of heroku
11:56justinlillyahh. neat. Didn't realize they offered more hosting options these days.
11:59sritchiejesus, just went into #java, it's crazy in there
11:59pjstadigjustinlilly: they have this whole new procfile thing
11:59sritchiethank you all for your civility
11:59pjstadigwhere you can run pretty much anything you want
12:00polyst(inc sritchie)
12:00sexpbot⟹ 1
12:00justinlillyhm. neat. I may check it out. Not having a reasonable place to deploy was one hesitation I had w/ messing around with some clojure webapps, but presumably, that's not an issue now :)
12:02seancorfield__i was pleasantly surprised by how easy it is to run clojure on heroku
12:04TimMcsritchie: "How does I hello world?"
12:05TimMc"WHAT IS MAIN"
12:05sritchieone of the first things I saw was "YOU'RE SHADOWING THE FUCKING VARIABLE!!!"
12:05TimMchaha
12:05sritchiesee, even cursing in here feels just wrong and terrible
12:06TimMc~guards!
12:06clojurebotSEIZE HIM!
12:06sritchieclojurebot: botsnack
12:06clojurebotThanks! Can I have chocolate next time
12:06sritchieobvi
12:06polyst$kill
12:06sexpbotKILL IT WITH FIRE!
12:07clgvclojurebot: chocolate
12:07clojurebotPardon?
12:07clgvlol
12:07dnolensritchie: well, you have to sympathize with #java. They must get the same 10 noob/student questions every couple of minutes.
12:09sritchiednolen: yes, the point's well taken -- grizzled as they are, at least those guys are in there answering questions
12:21wastrelclojurebot eh
12:30tufflaxWhen calling swap!, the actual swap happens in another thread right? I find that I'm using a lot of (swap! some-atom (constantly some-val)) and realized that that can be very bad if the last swap does not happen before I use the atom to create the next value that is gonna be the argument to constatly. I shouldn't be using constantly so much, right?
12:31hiredmantufflax: no
12:31tufflaxno? :p
12:31hiredmantufflax: there was a question somewhere in there, the answer is no
12:31clojurebotc'est bon!
12:32tufflaxhiredman there are 2 questions
12:32hiredmanfine: no, whatever you like
12:33tufflaxSo swap! happens in the caller thread?
12:34raektufflax: also, you can use reset! in this case
12:34raektufflax: yes
12:34tufflaxok, thanks
12:34raektufflax: the current value is read, the function is applied to create a new value and then the new value is compare-and-set!'ed in
12:34tufflaxah ok
12:34tufflaxdidn't know about reset!
12:35raekif the value had changed, the set fails and another attempt is done
12:35tufflaxi see
12:37edwAnyone here use redistogo? I'm trying to figure out where, if anywhere to pass in the user from the redis URL.
12:38edwI'm using redis-clojure...
12:38abedrahow does one file an issue with Ring?
12:38edwGithub?
12:38clojurebotgithub is http://github.com/clojure/clojure
12:38abedrathere's no issue page up on the github wiki
12:40edwHmm. The man doesn't want to be contacted...
12:41pjstadighttp://groups.google.com/group/ring-clojure ?
12:45abedraedw, it's fine, I just emailed mark
12:45abedrathere's a bug in wrap-params
12:46abedraunder the hood it calls URLDecode/decode
12:46abedraand if the param passed in is "%" that blows up
12:46abedrathrowing an exception and halting everything else
12:46edwWhereas it should call what? Something that also escapes query-string chars like ? and &
12:47abedrathat's why I emailed mark
12:47abedrathere are a few ways of working around this, but before I spend time putting together a patch I would like to get his input
12:47edwRight. I just forget the proper names of the more and less permissive versions.
12:49hugodIsn't weavejester maintaining ring now?
12:50abedrahugod, he might
12:50abedrabe
12:50abedrai should send him a note as well
12:54ilyakDamn. Why doesn't my ccw builder build clojure files?
12:54ilyakIs there any logs or something?
12:59duncanmhmm, anyone know how to copy an emacs stack trace?
13:00duncanmthe buffer seems kinda stuck, and once i press 'q', it goes away
13:09dpritchettI'm trying to figure out how my noir app is automatically reloading every time i save a view file. i can write a function, save, and hit f5 and the new function is there
13:09dpritchettI'm using lein run, noir uses ring/jetty by default i think
13:09dpritchettdigging around in the respective sources to figureo ut where the hot reloads come in
13:10midsdpritchett: its the reload-modified middleware in https://github.com/ibdknox/noir/blob/master/src/noir/server.clj
13:10dpritchettthanks mids
13:11dpritchettI'm quite glad it's doing this I just didn't expect it :)
13:12dpritchetthere's the ring.middleware.reload-modified source, fun read https://github.com/weavejester/ring-reload-modified/blob/master/src/ring/middleware/reload_modified.clj
13:39amalloyduncanm: C-x h to mark the whole buffer, then M-w to copy?
13:58edwIs there any consensus on the "best" redis client out there?
14:06dpritchetthow can i use array literal notation side by side with an array generating function
14:06dpritchettsay I have one function that returns an array with three k:v pairs
14:06dpritchettand i want to reference it from within a list where i specified two arrays literally and i want to specify the third using my function
14:07dpritchette.g. https://gist.github.com/04a93dcf80d8a5dd6913
14:08dpritchettah, found a stray paren nevermind
14:10wastrelparenthesis can be important
14:29devnAlso, how does everyone manage getting the latest build with leiningen? Is there some easy route I'm missing?
14:35dpritchetti just run "lein update" sporadically
14:46dnolenit's a bit annoying that ls
14:47dnolenoops sorry
14:47polyst(dec dnolen)
14:47sexpbot⟹ 2
14:47polyst;-)
15:00amalloyedw: i've used aleph a little for redis, and it seems fine
15:14gtrakyou guys ever thought of using akka for multi-node stuff? are there other alternatives for clojure that work better?
15:15seancorfield__anyone use clojuresque with gradle? pros / cons vs leiningen?
15:16hiredmangtrak: depends what you are distributing
15:16hiredmanakka is actors righ?
15:16hiredmanright
15:16gtrakyes
15:16dpritchettdoes hiccup usually spit out source with no whitespace? http://3y5n.localtunnel.com/todos
15:17gtrakI don't know exactly what to distribute, but I want to prototype with it in mind, so I want something flexible and light
15:17hiredmanactors are generally nice for modeling state machines, but if you are just distributing data processing in parallel then you don't need them
15:17hiredmangtrak: how can you not know that?
15:18gtrakjust experiementing
15:18gtrakfor my own gratification
15:18hiredmanwell then do whatever is most gratifying
15:19amalloydpritchett: yes
15:19gtrakbut i think it'll look like looping over a dataset, where the dataset is a cache that gets synched with a db or something
15:19amalloyi assume there's a setting/binding somewhere you can change
15:20technomancyI briefly looked into using akka. the docs assume you know scala, so I didn't get very far
15:20technomancyactually kind of glad I didn't spend more time on it after reading this: http://blog.darevay.com/2011/06/clojure-and-akka-a-match-made-in/
15:21gtrakyea, I just saw that
15:21gtrakthough you see at the bottom jboner's interested in seeing it work
15:22hiredmanI do have an as yet unannounced library that attempts to making working with message queues (hornetq) dirt simple to start with
15:22hiredmanhttps://github.com/hiredman/vespa-crabro
15:22technomancygtrak: yeah, there's promise; it's just not there yet
16:15amalloychouser: is there a finger-tree measure i could use/write that would support fast conjing onto one end, and fast dissoc from anywhere in the middle?
16:18devnthis new noir web framework looks promising
16:18devnhttps://github.com/ibdknox/noir
16:20dpritchettyeah its been fun playign with it today devn
16:20dpritchetti like having a few sensible defaults chosen for me so i don't have to figure out the whole stack myself
16:20dpritchettalthough reading this helped too http://brehaut.net/blog/2011/ring_introduction
16:31hicksterwhois chouser
17:04devna nice guy
17:09amalloydevn: the official #clojure faq
18:10sdeobaldDoes anyone know if there's a function in contrib (or otherwise) to convert camelCase into hyphen-case?
18:12amalloysdeobald: there are a few libraries with an implementation of that you could steal. i don't know of one in contrib
18:14amalloysdeobald: https://github.com/ninjudd/cake/blob/develop/src/cake/tasks/deps.clj#L95 is one, which i think i wrote
18:15tremolocouldn't you handle that with a relatively simple RegEx replace
18:20sdeobaldamalloy: Thanks. Was just hoping to avoid writing yet another. Guess it's probably just time to suck it up and assemble some sort of generic utils lib.
18:21amalloysdeobald: i approve of everyone having their own generic utils lib
21:17arohnerchouser: remember my "bug report" a few days ago about clojure.data.xml.pull-parser holding on to head? Turns out, it was the clojure keywords not being GC'd issue
21:18arohnerI'm succesfully dorun'ing across all of wikipedia now
21:37alandipertarohner: that's on 1.2?
21:38arohneralandipert: I was having problems on 1.2.0. The keyword GC issue is fixed in 1.2.1 (and trunk)
21:39alandipertarohner: cool, just wanted to make sure it didn't sneak back in
22:22carllercheis it possible to connect a repl to a running process?
22:25cemerickcarllerche: if your running process is running a network REPL server (like swank or nREPL), yes
22:26carllerchecemerick: is it sane to run swank and such in production?
22:26technomancywe have swank in production
22:26technomancyit's perfectly reasonable as long as you only listen on localhost
22:27cemerickcarllerche: That's a loaded question. You certainly can (I do).
22:27scgilardiif you can arrange to run code in the process somehow, you can open up a repl over a socket. examples: http://sean8223.blogspot.com/2009/06/adding-remotely-accessible-repl-to.html and http://clojure.github.com/clojure-contrib/server-socket-api.html