#clojure logs

2010-10-25

00:33amalloyymasory, dsantiago: technically not just the name after &. the last argument can have further destructuring
00:36amalloy,((fn [a b & {c :name}] [a b c]) 1 2 :name "steve" :age "paul")
00:36clojurebot[1 2 "steve"]
00:40amalloyheh. i guess paul isn't a good age. got distracted there :P
00:48DeranderWORDPRESSSSSSS
00:52amalloyis that so?
01:18rdeshpandeyo
01:23amalloyoi
01:27jackdempseyhehe
01:27jackdempseyamalloy: i turned "paul" just the other day
01:27amalloyhaha, well, i take back my apology then
01:30jackdempseyhmm, a little unclear on how that destructuring works
01:30jackdempsey,((fn [a b & {c :age}] [a b c]) 1 2 :name "steve" :age "paul")
01:30clojurebot[1 2 "paul"]
01:31jackdempseyamalloy: so & says "take the rest of the args and stick them in the next thing
01:31amalloyjackdempsey: yep
01:31jackdempseyand this next thing just happens to be a map
01:31amalloyyep. sneaky, innit?
01:31jackdempseyso
01:31jackdempseyhm
01:31jackdempseyheh
01:32jackdempseyi think i get destructuring normally
01:32amalloyheh. "normally"
01:32jackdempseybut this case seems a little different
01:32jackdempseyhaha
01:32amalloyjust wait. when you get this i'll show you some more trickery
01:32jackdempsey,((fn [a b & c ] [a b c]) 1 2 :name "steve" :age "paul")
01:32clojurebot[1 2 (:name "steve" :age "paul")]
01:33jackdempseyk that makes sense
01:33jackdempseybut to make sure i'm calling things the correct names: (:name "steve" :age "paul") is a .....list at that point?
01:33amalloyit's a seq. i think whether it's a list or a vector or whatever is none of our business
01:34jackdempseyk so & foo takes the rest of the args and puts them in a seq referred to by symbol foo
01:34amalloyright
01:34amalloy,((fn [a b & c ] [a b c (class c)]) 1 2 :name "steve" :age "paul")
01:34clojurebot[1 2 (:name "steve" :age "paul") clojure.lang.ArraySeq]
01:34jackdempseyah
01:35jackdempseyso it almost seems like it should be & {:age}
01:35jackdempseywhy {c :age}
01:35amalloyyou have to give it a binding
01:35amalloya way to refer to it inside the function
01:35jackdempseyc to name the arg and { ... :age} to destructure it?
01:35amalloyright!
01:35jackdempsey,((fn [a b & {:age c}] [a b c]) 1 2 :name "steve" :age "paul")
01:35clojurebotjava.lang.RuntimeException: java.lang.RuntimeException: java.lang.Exception: Unsupported binding form: :age
01:36jackdempseyaha
01:36Adamantjackdempsey: how's your left hook?
01:36Adamant:P
01:36jackdempseyAdamant: not too shabby... a bit rusty given the whole "being dead a couple decades" thing :-D
01:37Adamantwhy, you could lick any man alive at the time, I don't see how being dead would make any difference :P
01:37jackdempseyhehe
01:37jackdempseyman, watching IRT deadliest roads.....these drivers are insane
01:37Adamantjackdempsey: your real name or just a pseudonym? (in either case, someone had good taste :P)
01:38jackdempseyhehe, john by birth, but was too convenient to not go as jack
01:38Adamantah
01:38Adamant:)
01:38Adamantyeah that road in South America is crazy
01:39jackdempsey,((fn [a b & [foo & bam] [a b foo bam]) 1 2 :name "steve" :age "paul")
01:39clojurebotUnmatched delimiter: )
01:39jackdempsey,((fn [a b & [foo bam] [a b foo bam]) 1 2 :name "steve" :age "paul")
01:39clojurebotUnmatched delimiter: )
01:39jackdempseyhm
01:39amalloy,((fn [a b & [foo & bam]] [a b foo bam]) 1 2 :name "steve" :age "paul")
01:39clojurebot[1 2 :name ("steve" :age "paul")]
01:40jackdempseyoff to a repl to hide my f'ups :-D
01:40jackdempseyhmm
01:40Adamantif clojurebot does PM that could work
01:40amalloyhe does
01:40jackdempseyhuh, gotta read that again, don't see the difference
01:40amalloyyou missed a ]
01:40amalloyin the arglist
01:40jackdempseyahh i see
01:41jackdempseyinteresting
01:41jackdempseyso any tips on the destructing piece in the sense that: the structure you use to destructure needs to be _____ with the structure it's trying to destruct?
01:41jackdempseygood lord that's a mouthful
01:42amalloymust be an earful too, cause i don't think it got through my ear to my brain. try again?
01:42jackdempseye.g. i understand that a map works to destructure a map...and a vector can work on a seq....but it's a bit jumbled to me
01:42jackdempseyheh
01:42jackdempseyis there a good place to read on how/what i can use to destructure things?
01:43amalloyhmmm, i think ss has a good blog post on it, and JoC definitely has a nice entry
01:43amalloyhttp://stuartsierra.com/2010/01/15/keyword-arguments-in-clojure is not *quite* relevant, but probably helpful
01:44jackdempseycool. so now that i sorta/kinda get it...what was that cooler bit you wanted to show me?
01:44amalloyhaha, i was gonna show you :or and :keys
01:46jackdempseyok
01:46amalloy,((fn [a b & {c :name d :age :or {d 10}}] [a b c d]) 1 2 :name "steve")
01:46clojurebot[1 2 "steve" 10]
01:47jackdempseyyeah
01:47jackdempseythat makes sense
01:47jackdempseyso
01:48jackdempseythe {c :name} bit is correctly thought of as binding the {third-arg :name} to c and {third-arg :age} to d
01:48jackdempseyexcept :age doesn't exist, so give it a default value of 10
01:48amalloy*nod* i think that's about right
01:49amalloy,((fn [{:keys [a b c d]] [a b c d]) {:a 1, :c 8})
01:49clojurebotUnmatched delimiter: ]
01:49amalloy,((fn [{:keys [a b c d]}] [a b c d]) {:a 1, :c 8})
01:49jackdempseyi guess the final bit is being crystal on how & {c :name} turns into binding :name from the arg into c. it's like you're using a familiar form but not the same call semantics
01:49clojurebot[1 nil 8 nil]
01:49jackdempseywhich would make me think i'm calling :name on c
01:49jackdempseylol the face
01:50jackdempseynice, yea i've seen :keys a little. is it used much in practice?
01:50amalloyhah, i dunno. i don't do a lot of anything, in practice
01:50amalloyyeah, the fact that {a :name} rather than {:name a} is used for destructuring is a bit confusing
01:51amalloybut it's so that things like :keys, :or, and so forth can't possibly be "normal" destructuring
01:51kryftAre there any vimpulse users around, btw?
01:51amalloybecause :or is an illegal variable name
01:52jackdempseyhmm
01:55amalloythere are also :strings and :symbols equivalent to :keys. i've never used them, so they might be :strs and :syms or something
01:55jackdempseycool
01:55LauJensenMorning all
01:55amalloymorning LauJensen
01:55jackdempseyah
01:55jackdempseyThe keys of the binding map are the local variables you want to create. The values of the binding map are keys in the initialization expression. The locals will be bound to the values of corresponding keys.
01:55jackdempseythat helps
01:56amalloygood, good
01:56vibrantmorning
01:58jackdempseyha :keys reminds me of explode or whatever that was in php
01:59jackdempseythat took a hash and made locals from the keys in it
01:59amalloyoh blech. thank god i haven't run into that yet
02:00amalloyhey LauJensen, since you got so sad yesterday i went and read your blog post about the orbital simulator, and i don't think you're right about the anonymous functions in distance/vector
02:00LauJensenamalloy: I dont remember being sad yesterday, and yes you're right about the anon fn, I spoke too soon
02:00LauJensen(read the comments)
02:00amalloyah. you were "offended" i didn't follow your blog
02:01LauJensenyea that was a joke old chap
02:03amalloyhence my "scare quotes"
02:03vibrantso how do i represent 'objects' in clojure? like i na game i have a player, i created a hash-map for him and def'ed it to a global variable - how do i modify that map now?
02:05LauJensen,(let [player (atom {:health 100 :name "Frank"})] (swap! player update-in [:health] dec))
02:06clojurebot{:health 99, :name "Frank"}
02:06LauJensenvibrant: Get familiar with Clojures reference types. For a game you might want refs instead of atoms
02:07amalloyLauJensen: i was going to suggest passing the player around instead of making him a global. seems a lot more functional to me. i assume you have a good reason for your approach, though; what is it?
02:07vibrantLauJensen: yeah I'll get there. now I just managed to boot up clj-processing and I'm experimenting with the base stuff and learning Clojure in the meantime :)
02:07LauJensenamalloy: Your idea is better for something like Pacman I suppose, though for a more complex game, the pain of passing everything stateful around in args, not to mention the performance hit would be counterproductive
02:08LauJensenGenerally, a great strength of Clojure, is to handle inherently stateful tasks correctly. Ie. not pretending there is no state
02:09amalloyis there really much of a performance hit? it seems like swap! is going to have to create new objects and so on anyway, so the only hit seems to be passing around some pointers
02:11amalloyi may be biased because my "game" does a lot of backtracking depth-first search, so i want to have old states available
02:13LauJensenamalloy: Well. I cant think of a one-size fits all answer re performance. The two hits you take are allocation and subsequent GC. Typically I think we see more seq traversal in programs that pass everything around. Though I might just be imaging that
02:14kryftLauJensen: Is there a big performance hit from seq traversal?
02:14amalloyi guess you do get more allocation passing stuff around, if you want to do deeply-nested modifications (eg changing the player's pet's hair color)
02:15LauJensenkryft: something like (-> this-seq map filter remove) etc, generates n number of seqs where n is the number of items in the list. However subsequently swapping that into an atom doesnt give a large overhead
02:22LauJensenamalloy: I guess in most cases, the only measurable performance diff, is whether or not you resort to transients, arrays or pods
02:22amalloyheh
02:22yayitsweiwhen you guys get a chance, could you help me rewrite my recursive group-by function in idiomatic clojure? http://gist.github.com/644489
02:26amalloyyayitswei: you can get rid of the yucky first/rest with destructuring
02:26LauJensen,(reduce #(let [[d m y] %2] (assoc %1 m (conj (%1 m []) [d m y]))) {} [[30 9 2010] [30 10 2010] [31 10 2010]])
02:26clojurebot{10 [[30 10 2010] [31 10 2010]], 9 [[30 9 2010]]}
02:26amalloy(loop [t s [f & fs] starting-fns] (use f and fs))
02:27LauJensenor I guess you could do something like that
02:27LauJensenamalloy: you'll be surprised to learn that such destructuring is much slower than first/rest/next
02:27amalloyindeed i will be surprised, LauJensen!
02:27LauJensenEven if you have to call first/rest 2 or 3 times, it will still be faster
02:28yayitsweivibrant: btw, I'm reading Stuart Halloway's book and he has a good example on Clojure snake using refs: http://github.com/stuarthalloway/programming-clojure/blob/master/examples/snake.clj
02:28amalloyLauJensen: your solution does a different thing than his function, though
02:28LauJensenamalloy: you mean in that its not recursive+
02:29amalloymaybe; i'm not sure what you mean. he seems to want nested maps for each grouping function
02:30yayitsweiwow your versions are so much more dense
02:30yayitsweiamalloy: yes, I believe that's what I want, trying it now
02:30LauJensenamalloy: of you're right, he's passing 2 f's
02:31amalloyLauJensen: i'm sure using reduce will be more idiomatic and/or better, but i didn't want to try and figure out how the function worked so i just pointed out a nice-looking fix
02:32LauJensensure, so now he has 2 options :)
02:32yayitswei,(doc use)
02:32clojurebot"([& args]); Like 'require, but also refers to each lib's namespace using clojure.core/refer. Use :use in the ns macro in preference to calling this directly. 'use accepts additional options in libsp...
02:32yayitsweiinteresting usage of 'use'
02:34LauJensenamalloy: I think you confused the man though
02:34yayitsweioh wait, that's pseudocode
02:36amalloyLauJensen: you're right, i should have used more parens and %s. that helped make your example more readable :)
02:37LauJensenah you resort to mocking now do you? :D
02:38amalloyyeah, i gave up on actually looking smarter a while ago
02:39yayitsweiamalloy: you're right though, I did want a nested hash. it took me a while to digest yours and Lau's suggestions
03:01LauJensenyayitswei: I understand why amalloys was hard to digest, but mine was quite elegant was it not? :D
03:02amalloy*laugh*
03:06LauJensenHere's a nested version
03:06LauJensen,(for [f (list first second)] (reduce #(assoc %1 (f %2) (conj (%1 (f %2) []) %2)) {} [[30 9 2010] [30 10 2010] [31 10 2010]]))
03:06clojurebot({31 [[31 10 2010]], 30 [[30 9 2010] [30 10 2010]]} {10 [[30 10 2010] [31 10 2010]], 9 [[30 9 2010]]})
03:10amalloywell, now that LauJensen has proved he's the best i'm off to bed
03:11amalloynight folks
03:11yayitsweiLauJensen: ah, thanks! very much appreciated. amalloy too :D
03:11LauJensenamalloy: dont forget to follow bestinclass.dk, sleep tight
03:11yayitsweinight
03:11amalloyhaha
03:11LauJensen:D
03:21NafaiIs there an easy way to call out to another process from within my clojure code?
03:22LauJensenNafai: elaborate
03:23NafaiI want to get the output of an external program and then process it in Clojure
03:23NafaiIt's not something I've ever had to do in Java either
03:23LauJensen,(doc sh)
03:23clojurebotIt's greek to me.
03:23LauJensenNafai: In contrib there's an 'sh' function, (sh "ls" "-l") will return a string, representing the output from ls -l
03:24NafaiSweet, thanks.
03:24LauJensennp
03:43cpfrHey is there a nice way to do introspection on java class instances
03:49hoeckcpfr: bean?
03:49hoeck,(bean "foo")
03:49clojurebot{:empty false, :class java.lang.String, :bytes #<byte[] [B@1d4ea6c>}
03:53cpfrall bean is telling me is the class
03:55hoeckcpfr: it uses public fields only, yes
03:56cpfrbut this class has to have some public fields or methods
03:56cpfrhow else would it useful
03:57hoeckbean only creates a map of the class public fields
03:59jarpiainno, bean calls the methods named getFoo() and isFoo() and returns a map of the results
03:59hoeckjarpiain: sorry, you're right, lived too long in clojure land
04:43javehello
04:44javeI'm having difficulty setting headers in a compojure response
04:45AWizzArdjave: how do you try to do it?
04:46jave (GET "/header" [] {:headers {"Content-Type" "image/svg+xml"} :body "body"})
04:47AWizzArd(defn handler [request] ... [{:headers {"Content-Type" "application/json"}} "<html><head></head><body>Hallo Leute</body></html>"])
04:47AWizzArdI return a vector of two elements.
04:48javehmm
04:48AWizzArdThe first, a map, only contains one key/value pair, and the second is the body string.
04:48AWizzArdTry if this works for you.
04:49javeok
04:54xkbif this is the input: (MyMona.core/draw-polygon graphics {:color {:red 55, :green 2, :blue 62, :alpha 231}, :points [{:x 121, :y 89} {:x 102, :y 17} {:x 3, :y 17} {:x 46, :y 82} {:x 150, :y 6}]}) How would I get :points using destructuring?
04:56xkbI'm using 2 nth's now
04:56xkbreally ugly and sometimes returns errors on persistenvector not being able to do nth :?
04:57LauJensen java (content-type (response x y z) "image/svg+xml")
04:57LauJensenjave even
04:58hoeckxkb: (let [{c :color p :points} ...])
04:59xkbhoeck: even if :points is nested in the seq?
04:59hoeck(let [{c :color [p0 p1 p2 p3 p5 :as p] :points} ...])
04:59hoeckor {[p0 p1 & pn :as p] :points]} ..
05:00xkblet me try it in the repl
05:01hoeckand to get the x and y of each point: (let [{[{x0 :x y0 :y} {x1 :x y1 :y}] :points} ...])
05:02xkbThanks, Ill tinker around with it
05:02hoeckxkb: basically two rules, maps are destructured by writing the symbol to bind to first, then the key
05:03hoeckxkb: and for vectors, just write the structure of the vector on the left side of the let :)
05:04hoeckxkb: this explains all the details: http://clojure.org/special_forms#Special%20Forms--%28let%20[bindings*%20]%20exprs*%29
05:04xkbcool! nice link
05:05xkbgot alot of inspiration to rewrite my code at the conj :)
05:48ordnungswidrighow can I get the ns of a function? (->> foo meta :ns) only works for fn hold in a var, not for reduce, e.g.
05:50raekordnungswidrig: if you have the symbol, you can use 'resolve'
05:50raek,(resolve 'conj)
05:50clojurebot#'clojure.core/conj
05:50ordnungswidrigraek: I need the other way round
05:50Chousukea function might not have a name
05:50Chousukehmm
05:50ordnungswidrigChousuke: ok, for those that have a name
05:50Chousuke,(meta (fn []))
05:50clojurebotnil
05:50ordnungswidrig,(meta reduce)
05:51clojurebot{:line 786}
05:51raek,(meta conj)
05:51clojurebot{:line 77}
05:51ordnungswidrigor will clojure.core map to the empty ns?
05:51raekthe function is unaware of the name of any var pointing to it
05:51ChousukeI suppose the function might not even have a namespace
05:52Chousukeit could be an IFn instance passed to you from some java user.
05:52ordnungswidrigChousuke: I see
05:52ordnungswidrigChousuke: but the var has a name
05:52ordnungswidrigand an ns
06:07javehow does compojure routes relate to ring handlers?
06:07javebasically I'm now trying something like this, but its not working: (ring.util.response/content-type (GET "/header" [] (overview)) "image/svg+xml")
06:29AWizzArdordnungswidrig: isn't the NS on the meta data?
06:29AWizzArdjave: did it work?
06:30AWizzArdyou did not give feedback so far ;)
06:31javeAWizzArd: sorry....
06:32javeit didnt work
06:32javeI'm scratching my head here
06:35AWizzArdMaybe the behaviour changed. I am using an older version of Compojure.
06:35javeyes maybe
06:42raekjave: I'm not sure you can attach middleware that way
06:43javeproblem is there is so many conflicting docs on compojure because of the many revisions
06:43raekit seems like you have to wrap the whole routes thingy in the middleware, rather than just the GET part
06:43raekjave: I would recommend Moustache
06:43raekthe docs are very clear
06:43javeok
06:44javebut does moustache replace compojure, or what is the relationship?
06:44raekmoustache is a routing lib
06:44raekso it replaces defroutes
06:45javeok
06:45raekyou use it with ring as I guess you use compojure with ring
06:45javeso, what would my simple case look like then? I just want to set the content-type header
06:46raekusing middleware is very simple
06:46raekhttp://gist.github.com/644761
06:47raekthat is what I have in one of my projects
06:47raekthe (app ...) form creates a ring handler
06:47raekyou can prefix you routes with any number of middlewares
06:48javecool ill have a look
06:48raekhere's the moustache docs
06:48raekhttp://github.com/cgrand/moustache
06:48raekif you are used to reading grammars, you'll love this: http://moustache.cgrand.net/syntax.html
07:00bartjchouser, does clojure-jna also support calling third-party c++ libraries ?
07:00bartjchouser, from Clojure that is
07:48_na_ka_na_Hi, can I rely on using (:sigs AProtocol) to create me helper macros?
07:48_na_ka_na_Hi, can I rely on using (:sigs AProtocol) to create me helper macros?
07:48_na_ka_na_or is there some other way to extract fn specs from a protocol
08:16chouser_na_ka_na_: I don't think it's documented anywhere, so that detail could probably change without warning.
08:17chouserbut would likely be replaced by something else with similar information, right? So, at your own risk... :-)
08:17_na_ka_na_chouser: thanks :)
08:21ordnungswidrigI'm playing with clojure agent. the tx spanning a dosync body will commit/rollback the state of all ref written, right?
08:22raekfrom outside the tx, all refs will seem to be untouched if the tx failed
08:23raeki.e., all ref changes remains transaction-local until the transaction succeeds
08:23ordnungswidrigraek: and in the case (dosync (dosync (alter foo …) (alter bar …)) (alter foo bonk) when bonk fails, then bar remains altered?
08:24raekno, the outermost transaction gets restarted
08:24ordnungswidrignice
08:24raekalso, calls to send and send-off inside a transaction is held until it succeeds
08:24ordnungswidrigin what way can a tx fail? exception or validator, right?
08:25raekthat or another transaction modified a ref that the current transaction relied on
08:25raekin the latter case, the transaction is simply restarted
08:26ordnungswidrigin case of exception will the tx be rolled back and the exception bubbles?
08:27raekyes
08:27ordnungswidrigand in case of a validator?
08:27raeksame thing
08:27ordnungswidrigexception?
08:27clojurebothttp://paste.lisp.org/display/74305
08:28raekboth will result in that no refs were changed, and that an exception comes out from the dosync block...
08:28ordnungswidrigraek: Ok, thanks for the tutoring :)
08:28raeknp :)
08:29ordnungswidrigraek: to give you some context: I play with event-sources / cqrs using clojures stm.
08:29ordnungswidrigs/event-sources/event-sourcing/
08:29sexpbot<ordnungswidrig> raek: to give you some context: I play with event-sourcing / cqrs using clojures stm.
08:31raeknote that in clojure, you can have multiple threads banging on the same refs without concurrency problems
08:32raekbut thanks for the link. this looks interesting.
08:35ordnungswidriginteressting case with multiple threads. when doing command queueing / event sourcing you generally assume a serializable fixed order of events. thus you serizalize them at the outermost façade.
08:36ordnungswidrighowever when using a STM and CAS then you can also "listen" to the events acutally applied to the refs.
08:37ordnungswidrigsay, I don't care if the events were '(withdraw account1 200) (withdraw account2 100)' or vice-versa.
08:43raekI would be very interested in hearing about any findings you make in this STM + Event Souring area
08:43ordnungswidrigraek: any idea on how to capture the actual order of function application that where applied to refs?
08:44raekordnungswidrig: well, there is add-watch
08:44raekbut then, you only get the value before and the value after
08:45raekbut if you store a [value event-causing-this-value] tuple in the ref, maybe it could be used anyway
08:47raek(def a (ref [0 {:type :new-account}])) (defn withdraw [a x] (dosync (alter a (fn [[balance _]] [(dec balance) {:type :withdrawal, :amount x}]))))
08:48ordnungswidrigreak: i've seen the approach to attach the event as meta value onto the agent state and use add-watcher to extract the event out of the state.
08:49raekinteresting
08:49raekI don't have much experience with this, so this is all speculative ideas I have...
08:49ordnungswidrigbut multiple agents mean multiple threads and I don't see where a "global" order of event can come from.
08:50raekyou would need a master agent of some sort
08:50ordnungswidrigexcept the add-watchers sending the events to another agent "receiving" them
08:50ordnungswidrigyes
08:50ordnungswidrigon the watcher's side, right? not the "input" side.
08:51raekyes
08:51raekis there any need for one global event sequence?
08:51raekit could be constructed by merging the event sequences for all the refs
08:52raekif transactions are used, changes that affect multiple refs will be safe
08:52ordnungswidrigbut merge how? the events could depend on each other in theory.
08:52raekif you have, say, two accounts, each in one ref
08:53ordnungswidrigsay that e2 on ref2 depends on a certain state of ref1 which was produced by earlier event e1
08:53ordnungswidrigboth in different threads.
08:53ordnungswidrigthe tx for e1 already was committed when e2 executed
08:53raekthen e2 will be restarted with the new state
08:53raekyou can't change refs outside transactions
08:55raekassuming that the change described by e2 is done in a transaction too...
08:56chouserdon't forget about commute
08:57cgrandordnungswidrig: you may also consider proxying refs you want to instrument, hence you will get access to the actual fn and args passed to commute or alter (disclaimer: half functioning brain here)
08:57chousercgrand!
08:57cgrandchouser!
08:58angermanI wish there was something like Ingredients for java ...
08:59cgrandwhat are Ingredients?
08:59angermanhttp://fileability.net/ingredients/
09:00cgrandthanks!
09:00chousercgrand: which Guy Steele paper talked about keeping s-exprs as late in the macroexpand process as possible?
09:00ordnungswidrigyes, e2 sees the new state of e1. but the validator for e2 will check that a certain state of ref1 exists. e.g.
09:00ordnungswidrigso e2 must be later executed after e1
09:02cgrandhis thesis about RABBIT, and it was not only in the macroexpand phase in was in the whole compiler (macroexpansion, alpha rename, cps transform etc.)
09:02chouserok, thanks
09:02cgrandyw
09:03ordnungswidrigchouser: do you have an example on commute? I understand the theory but I never saw how to use it.
09:05chouserordnungswidrig: I mention it because it can allow for two transactions to touch the same ref at "the same time" without either restarting
09:06chouserI don't have a concrete use case for you. It turns I out don't use refs all that often.
09:10raekone example would be if two transactions tries to deposit money to the same bank account, commute would not cause the other transaction to restart.
09:10raekif T1 adds money to the account before T2 is done, it doesn't matter for T2 in this case
09:12ordnungswidrigreak: but when you bank has no cash initially, then withdrawal on t2 might depend on deposit on t1 event when t1 was in a prio tx
09:15raekyes, you would not want to use commute for withdrawals
09:16raekcummute is just like alter, except that the transaction does not restart if some else had changed that ref during the transaction
09:18ordnungswidrigso if I know the all functions applied on a ref are commuting then I can use commute instead, right
09:37tonylgood morning
09:42angermanis there a map that doesn't retain the head?
09:43fliebelCan anyone help me understand zippers? I get the up down left right stuff, but the same can't be said about modifying them. I want to add an item to the bottomrightmost branch.
09:44fliebelI also don't understand the difference between a node and a loc.
09:45tonylfliebel: I am starting to learn on zippers too, but I found a good quick explanation on how to edit them http://www.exampler.com/blog/2010/09/01/editing-trees-in-clojure-with-clojurezip/
09:45fliebelSo I want to go from [1 2 3 [4 5 [6]]] to [1 2 3 [4 5 [6 7]]]
09:45fliebeltonyl: I'll look at it.
09:46chouserfliebel: a node is one of the things you passed in orignially: a vector or number in your example
09:49chousera loc is a zipper, that is a node plus its location in the whole tree
09:49chouser(-> [1 2 3 [4 5 [6]]] z/vector-zip z/down z/rightmost z/down z/rightmost z/down (z/insert-right 7) z/root)
09:50cgrandangerman: what do you mean?
09:50angermancgrand: I guess I ment something like doseq or dotimes :D
09:51chouserthe return value of each of those steps from vector-zip through insert-right is a loc. z/root walks from that final loc back to the root loc, and converts the root loc back into a node
09:51fliebelchouser: And what if I don't know the amount of nesting?
09:51chouserfliebel: you'll have to loop.
09:52fliebelchouser: With 'branch?'?
10:06ordnungswidrigdoes it make sense of have a ref holding a vector of refs?
10:07opqdonutprobably not
10:07chouserordnungswidrig: yes, but may be a premature optimization. Why not just a ref of a vector of values?
10:08ordnungswidrigchouser: i want different stm tx contexts for the contained refs.
10:08ordnungswidrigchouser: and yes, it is premature optimization.
10:11angerman,(float-array [[ 1 0 0]])
10:11clojurebotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.lang.Number
10:11angermanhmm ..
10:12mefesto,(float-array [1 0 0])
10:12clojurebot#<float[] [F@10a3ffc>
10:12angermanyea, it's 1d though :/
10:12mefestoah
10:15mefestomaybe this?
10:15mefesto,(into-array [(float-array [1 2 3]) (float-array [4 5 6])])
10:15clojurebot#<float[][] [[F@aaa10>
10:15angermanyea. looks like that. to-array-2d did return obj :)
10:16mefestooh nice
10:19fliebelchouser: still stuck with zippers :( http://gist.github.com/645022
10:19technomancyhttp://p.hagelb.org/hammock.jpg
10:20mefestos/is/his/
10:34jaleyhey guys! does anyone know if there's a function in core or contrib equivalent to this? ,(first (sort-by last (seq {:a 1 :b 2 :c 0})))
10:34jaleyi find myself using it quite a lot :/
10:35raekI would write it without the seq call and with val instead of last
10:36ordnungswidrigam I correct, that the validator-fn of a ref reads the new values of any ref in the current ty?
10:36ordnungswidrigs/ty/tx/
10:36chouser,(apply max-key #(- (val %)) {:a 1 :b 2 :c 0})
10:36clojurebot[:c 0]
10:36jaleyraek: yes.. that's more sensible
10:37jaleychouser: there is also a min-key
10:37chouserjaley: oh indeed, thanks.
10:37chouser,(apply min-key val {:a 1 :b 2 :c 0})
10:37clojurebot[:c 0]
10:38jaleychouser: and thank you, because i hadn't found it either :p
10:38Raynes&(- 10)
10:38sexpbot⟹ -10
10:39ordnungswidrigis the difference between refs and agents sync vs. async?
10:41raekordnungswidrig: validators are used when the transaction body is finished and the changed refs are about to be written
10:42ordnungswidrigraek: so kind of last resort
10:42raekordnungswidrig: yes, but agents are also uncoordinated
10:42raekwell, send operations are held in transactions..
10:43ordnungswidrigraek: in a agent validator-fn the values of other agents that are derefenced are coordinated?
10:44raekhrm, wait. validators could perhaps be checked at the alter calls. didn't think of that.
10:44raekordnungswidrig: only reads from refs are coordinated
10:45raekand by coordinated I mean read from a single point in time
10:46ordnungswidrighmm
10:49ordnungswidrigok, I think i've bean bitten by the uncoordinated part in agent :-)
10:50ordnungswidrigwhen I reference a value of an agent in the update function of another agent, than there is no coordination, right?
10:50ordnungswidrigtheat means @(send a1 inc) will not necessarily return the new value
10:51raekexactly
10:52raekagents don't guarantee that
10:52raekthe only thing you know is that the state transition function will be applied at some time in the future
10:53ordnungswidrigin my example in the update function I need to generade a globally unique id. managing that id with an agent would not work, but with a ref, yes, right?
10:53raekif you need rely on that the transition has been made, maybe agents aren't the best reference type to use in that sutuation
10:54raeka ref would work, since it is synchronous
10:55ordnungswidrigassume each agent would containt the balance of an bank account, than there would be no way to ensure that the sum of balances of all account are positive, right?
11:00angermanimage is always black (when painted using paintComponent) though the values in the Raster are not ...
11:01raeki.e., alter does not return until the transition has happened
11:01raekordnungswidrig: no. by the time you have checked all the accounts, they might have already changed. it sounds like a typical use case of refs... :)
11:01raek"no" as in "there is no way"
11:02RaynesRefs are the only game in town for coordinated change.
11:03raekRaynes: back from the conj?
11:04ordnungswidrigbut I should get multiple threads working on this if they work on mostly distinct sets of refs, right?
11:04Raynesraek: I was back yesterday.
11:04RaynesI'm sick as hell.
11:05raek:(
11:05RaynesBlowing blood and such.
11:05RaynesGuess I have a cold and a sinus infection.
11:05RaynesAwaiting antibiotics.
11:07raekrefs are safe to use in any number of threads combined with any number of refs. the performance might be bad if every thread alters every ref, though...
11:08raekordnungswidrig: also, have you seen this? http://blip.tv/file/812787
11:09ordnungswidrigraek: thanks for the pointer
11:09Raynesraek: If you've got the time, I'd be interested in hearing of the presents you've written me.
11:10ordnungswidrigraek: yes, if every tx reads every ref (like in the global balance example) then this cannot be parallelized
11:14raekRaynes: if course! :)
11:14raekwait 10 minutes and I'll commit what I'm working on right now
11:15raekjust need to test it first
11:25rdeshpandehowdy
11:27rdeshpandels
11:27rdeshpandedfls
11:27rdeshpandeoops - sorry about that
11:27tonylhehe
11:33kevinstrying to get my clojure chops up but I'm having trouble getting my imperative head around this. This produces the first 1000 digit long fib number, but I need to know how many fibs came before it (i.e. some kind of counter while it's looping..how many calls to fibs were made?) I don't really know where to put something like a counter....Have a feeling I'm using the wrong approach.
11:33kevins(use 'clojure.contrib.lazy-seqs)
11:33kevins(take 1 (filter #(= (count (str %)) 1000) (fibs)))
11:34chouserkevins: how about take-while instead of filter?
11:36KirinDavekevins: I'd rewrite it to use keep-indexed.
11:37florianjunkeraleph's websocket support is broken. In 0.1.0 it works, in 0.1.2 it doesn't.
11:38abrooksI hope the videos are up soon. I keep wanting to link people to the various talks.
11:38KirinDavekevins: Something like this:
11:39KirinDave,(take 5 (keep-indexed #(when (even? %2) [%1 %2]) (iterate inc 0)))
11:39clojurebot([0 0] [2 2] [4 4] [6 6] [8 8])
11:39KirinDavekevins: (when ...) is your friend for keep and keep-indexed.
11:45angermanhow would you write a histogram function in clojure? basically I have a sequence of all values. and now I'd need a value -> count mapping.
11:46chouserangerman: use, or refer to the source of, 'frequencies'
11:47angermanhmm let's see
11:48mefestothat should be in core as of 1.2
12:13raekhow does this SNAPSHOT convention work? if I have "1.0.1-SNAPSHOT", is the next stable version "1.0.1" or "1.0.2"?
12:13flx_, (doc let)
12:13clojurebot"([bindings & body]); Evaluates the exprs in a lexical context in which the symbols in the binding-forms are bound to their respective init-exprs or parts therein."
12:14cemerickraek: the convention is that XXX-SNAPSHOT indicates unstable/development versions of XXX.
12:16jweissif my macro just expands into a defn, i don't need to worry about using gensym on the args list right? because those symbols are only inside the scope of the defn anyway... right?
12:18dpritchettsnapshot is a prerelease designation i believe
12:18dpritchettso it predates 1.0.1
12:19dpritchettalso http://semver.org/
12:22LLLLOhow would you go about stripping all mark-up from a html page
12:23apgwozLLLLO: have a look at tagsoup (http://home.ccil.org/~cowan/XML/tagsoup/)
12:23raekLLLLO: I would use enlive and do a http://gist.github.com/645239 on the interesting node
12:23raekLLLLO: also, envlive uses tagsoup for the parsing
12:24apgwozLLLLO: what raek said, my next thing was to just pull out all the text nodes
12:24LLLLOhm
12:24LLLLOthat single function does all that?
12:24raekan example of a titlebot that pulls out the title element http://github.com/raek/lcug-examples/raw/master/bot/src/se/raek/lcug/titlebot.clj
12:24LLLLOoh right, it requires to parse them into nodes first
12:24LLLLOwhat kind of nodes?
12:24raekhowever, it should use the function I posted before... currently it only takes the first text node
12:25pdloganjweiss: if you are introducing new variables and splicing in a body of arbitrary expressions you need to ensure your new variables do not hide those in the body that should be "free"
12:25raek<foo bar="baz"><a/>quux</foo> --> {:tag :foo, :attrs {:bar "baz"}, :content ({:tag :a} "quux")}
12:26LLLLOtbh I first have to figure out where to put my downloaded clojure jars to be able to use them in REPL in clojurebox
12:26pdloganOTOH if you are only creating new variables the programmer has explicitly designated as "new bindings" then you should be fine.
12:26jweisspdlogan: ok like in a let inside the defn.
12:26jweissi think i should be fine there, thanks
12:26raekLLLLO: use a project management tool like Leiningen or Cake
12:27LLLLOwill that work with slime?
12:27iveyLLLLO: "lein swank" starts a swank server inside the project
12:27pdloganjweiss: e.g. (let [a 1 b 2] (jweiss-macro ... (+ a b) ...))
12:27raekyes, you run lein swank in the project and connect to it with slime-connect from emacs
12:28raekLLLLO: http://github.com/technomancy/leiningen#readme
12:28iveyLLLLO: also, http://github.com/technomancy/durendal ... durendal-jack-in starts appropriate swank with lein, starts slime and connects it up
12:28raekoh, neat!
12:28pdloganif jweiss-macro defines a or b in a new scope then "bad macro"
12:29raekLLLLO: look at the project.clj file of http://github.com/raek/lcug-examples/tree/master/bot/ for an example project.clj
12:29pdloganit's always safe to gensym if you want "hidden" variables
12:29jweisspdlogan: my generated code won't be needing to refer to anything outside its own scope
12:30raekthe things you are interested in are probably the line containing enlive and swank-clojure
12:30jweisswell, ok some things, but i know the data passed to the macro will never collide with those things
12:30LLLLOman....
12:30apgwozjweiss: "never" is an interesting word
12:30LLLLOback to make files and make command-line app, are we?
12:30iveyLLLLO: some of us never left...
12:30LLLLOI know
12:30ivey:-)
12:31jweisswell, the alternative is to have unreadable arg names on the fn my macro generates
12:31raekwell, you do not have to worry about the CLASSPATH anymore
12:31pdloganjweiss: if your macro includes the programmer's own expressions then there is a chance you could collide, that is all.
12:31apgwozjweiss: the problem with macro expansion is the context that it's expanded in. that's how you get name capture.
12:31raekand with durendal, it seems that you don't even have to run the commands manually
12:31apgwozif you can be sure that your macro only ever expands at the toplevel, then you're pretty much ok
12:31jweisspdlogan: no expressions are passed to the macro
12:32apgwozbut, if your macro could be expanded within any other form, there's trouble
12:32apgwoz... or at least potential trouble
12:32raekbasically, Leinginen takes care of downloading the right jars and starting clojure with them on the classpath
12:32jweissand i already know the context in which it should be expanded - all i'm doing is taking a data structure that defines an xmlrpc api, and defn'ing everything in there so that i have real clojure fn's instead of having to call the xmlrpc client explicitly every time.
12:34LLLLOhm
12:35LLLLOwhat does this do: (defn somefn [&rest] rest)
12:36dpritchettdurendal-jack-in sure is taking its time for me, wonder if i can peek into it to see if it's working
12:36dpritchetti have a simple app going that i was using a manual lein swank + slime-connect process with before
12:36dpritchettis there a specific context i need to be in when i invoke durendal-jack-in?
12:36iveydpritchett: it's a little slow for me too. it's starting swank, and i think it waits a while to make sure it's running fully
12:36tonylLLLLO: [&rest] puts the rest of the arguments passed to the function in a vector
12:36technomancyit actually doesn't have to poll; it just waits for swank to announce it's listening on a port
12:37technomancybut it has no error reporting, which is awful.
12:37iveyyeah whoever wrote it should be ashamed
12:37LLLLOtony1, it doesn't
12:37dpritchettso where do i invoke it from? I've got core.clj open in a window and i did a jack-in and my server is still "starting" 30s later
12:37tonyl,(let [f (fn [& rest] rest)] (f :wer 4 5 3 "ewr"))
12:37clojurebot(:wer 4 5 3 "ewr")
12:37LLLLOif I run it with more than 1 argument it throws an exception
12:37technomancyLLLLO: needs a space between & and rest
12:38tonylthere should be a space between & and rest or whatever you want to name the sequence of arguments
12:38tonylyup
12:38LLLLOright... but if there is no space, why does it return some weird object?
12:38LLLLO,((fn [&rest] rest) "ha")
12:38clojurebot#<core$rest clojure.core$rest@e6529c>
12:39LLLLOwat?
12:39clojurebotFor Jswat: start clojure with -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888
12:39LLLLOlol
12:39amalloy,(let [&rest 1] [rest &rest])
12:39clojurebot[#<core$rest clojure.core$rest@e6529c> 1]
12:39technomancyLLLLO: that's the value of the clojure.core/rest function, which is what the last thing in the fn resolves to
12:39amalloyLLLLO: ^^
12:39tonyllol
12:39LLLLOok makes sense now
12:41dpritchettyeesh, i mustve invoked it wrong. i can only find two durendal- functions available when i tab-complete from M-x
12:41dpritchetteven though there are plenty more in the source
12:41replacachouser: do you have any idea how to get my showoff preso onto heroku, but use your showoff rather than schacon's gem?
12:41dpritchettwas (require 'durendal) at the bottom of init.el not enough?
12:41technomancydpritchett: there's a distinction between interactive M-x commands and functions that only are called from elisp
12:42dpritchettah
12:42dpritchettso putting (require 'durendal) \n (durendal-enable) on successive lines in init.el is good enougH/
12:42dpritchettor do i even need to run the enable command?
12:42iveydpritchett: I don't run enable, and only call jack-in when I need it. It's the only piece I use so far.
12:44dpritchettthanks
12:46LLLLO"Closing over data is far more general than the simplistic model offered by private, protected, public, friend, et al. in OO languages." -> also 50 times slower
12:46LLLLOprice to be paid
12:47cemerickLLLLO: why "50x slower"?
12:48dpritchetti did a quick `killall java` and and restarted emacs and durendal seems happy now. thanks for the tips
12:48LLLLODon't know, but that's what my tests show
12:48cemerickLLLLO: I'm fairly confident your tests are wrong. :-)
12:48LLLLOcreating closures means generating entire class :)
12:48cemerickonly once, when the code is compiled
12:48technomancy50 times slower to compile might be true, but the runtime cost is negligible.
12:49LLLLOno, since each closure is unique in regards to the data captured
12:49LLLLOit can't be created only once
12:49cemerickLLLLO: the bindings that are closed over changes every time you create one? Quite untrue.
12:50LLLLO,(time (dotimes [n 100000] (Integer. n)))
12:50clojurebot"Elapsed time: 30.926 msecs"
12:50technomancyLLLLO: you're confusing creating a new class with creating a new instance.
12:51LLLLOstill the times don't lie
12:51dnolen,(time (dotimes [n 100000] (let [n (Integer. n)] (fn [] n))) )
12:51clojurebot"Elapsed time: 21.67 msecs"
12:52LLLLOyes now try to make the closure function like an object with 3 fields
12:52cemerickodd, that was faster than *not* using a closure ;-)
12:52dnolenLLLLO: but why you do that?
12:53LLLLOI don't know...maybe because it's given as an example in every clojure book?
12:53LLLLOas in, what you're supposed to do with the power of closures instead of using objects
12:53dnolenLLLLO: what books?
12:53LLLLOClojure in Action for one
12:54LLLLOI'm pretty sure that Programming Clojure has the same thing
12:54amalloyLLLLO: closures are implemented as anonymous classes with an invoke() method. their constructor takes N arguments, one for each object it closes around
12:54amalloycreating a closure is just a new X() - it's not slow
12:54cemerickLLLLO: I'd suggest pasting an example of these tests you've run, so this can get concrete.
12:54dnolenLLLLO: I'm pretty sure nothing of the kind is strongly recommended in Programming Clojure or Joy of Clojure
12:54dnolenLLLLO: so not sure what you mean by "every book"
12:55LLLLOalso several websites advocate this
12:55LLLLOhttp://www.nofluffjuststuff.com/blog/stuart_halloway/2009/08/rifle_oriented_programming_with_clojure
12:55LLLLOhere's one
12:58dpritchetthey, durendal works better when you're running the latest clojure-mode
12:58dpritchettthanks for folding in the repl syntax highlighting technomancy
12:58dnolenLLLLO: Heh, yeah I wouldn't recommend that at all. using Closures to simulate mutable objects in Clojure is a terrible idea beyond understanding that it's possible.
12:58LLLLOstrangely the difference is smaller here than on my work computer
12:59LLLLOwhat would you do instead?
12:59dnolenLLLLO: defrecord
12:59LLLLO(defn new-int [n]
12:59LLLLO (fn [comm] (cond
12:59LLLLO (= comm :value) n
12:59LLLLO (= comm :radix) 10)))
12:59LLLLOthis for instance
12:59LLLLO(time (dotimes [n 100000] (new-int n)))
12:59LLLLO"Elapsed time: 13.852232 msecs"
12:59LLLLO(time (dotimes [n 100000] (Integer. n)))
12:59LLLLO"Elapsed time: 3.096241 msecs"
13:00LLLLOon my work computer it was 250 vs 4
13:00LLLLOor did I code that wrong?
13:00Chousukeyou could probably use case for that
13:00Chousuke(case comm :value n :radix 10)
13:01LLLLOcase?
13:01Chousuke(doc case)
13:01amalloyChousuke: he's never calling the function; it doesn't matter what the function does
13:01LLLLOdoes it use java switch
13:01Chousukehm
13:01LLLLOyeah I was just testing how fast the closure generation was
13:01Chousukeah right. I didn't notice that.
13:01LLLLOif it's a bad idea
13:01LLLLO,(doc case)
13:02amalloyLLLLO: if you're curious, try compiling to .class files and using javap -l (that's L)
13:03amalloyit should show you exactly how much work it is to create a closure, and you can evaluate that yourself
13:03LLLLOhm
13:04jarpiainLLLLO: case compiles into a lookupswitch of the argument's hash code
13:04amalloybut there's no way it's 50 times slower. even if it closed around 50 variables (not sure that's possible) it shouldn't be 50 times slower
13:05LLLLOyeah that's weird then
13:05LLLLObut I'm pretty sure I had such results this morning
13:05LLLLOI am thinking about way I could have screwed it up
13:05amalloydotimes is not a real benchmark. you get a lot of fluctuation due to, eg, whether your computer is busy syncing email
13:05amalloyor whatever
13:06dnolenLLLLO: well we've been using Clojure for some time now and if the perf for closures was that bad we probably wouldn't be using Clojure ;)
13:06amalloyclojurebot: ping?
13:06LLLLO:D
13:06LLLLOhm gotta look-up the case macro on Clojure Docs
13:06amalloyhe seems to be unstable more often now, for some reason
13:06amalloysexpbot: ping?
13:06amalloy$ ping
13:06sexpbotamalloy: Ping completed in 0 seconds.
13:06LLLLOI have hard time reading (doc case), I don't understand the syntax
13:07LLLLOthank god for examples on Clojure Docs
13:07LLLLO,(case first first true)
13:07amalloyLLLLO: clojurebot seems to be down. try sexpbot
13:08amalloy->(case first first true)
13:08sexpbotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.MapEntry
13:08LLLLOwhat?
13:08LLLLO->(case :first :first true)
13:08sexpbotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.MapEntry
13:09LLLLOok this is weird
13:09cemerickjeez, are both bots hosed?
13:10jarpiainseems to be the bug I reported
13:10jarpiainhttp://www.assembla.com/spaces/clojure/tickets/438-case*-and-code-walkers
13:10LLLLO->(+ 1 2)
13:10sexpbot⟹ 3
13:10amalloyyeah, clojurebot is hosed, sexpbot doesn't get case statements, apparently
13:11chouserreplaca: no -- let me know if you figure out a way
13:11amalloyLLLLO: your case statement works fine in a real repl
13:11cemerickwhy would it be doing any code-walking though?
13:11LLLLOoh ok
13:11@rhickeyanyone know what this is tryingto tell me? :
13:11@rhickey"/Users/rich/dev/clojure/build.xml:90: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds"
13:11LLLLOwell the second one works, the first one doesnt
13:11amalloyLLLLO: that's because first isn't a compile-time constant, but :first is
13:11chouserreplaca: I've moved all my "patches" except clojure syntax highlighting into the presentation itself, so that's the only thing missing when I push to heroku
13:12cemerickrhickey: you want to set includeantruntime="false" in your javac task usage (see http://www.jajakarta.org/ant/ant-1.6.1/docs/en/manual/CoreTasks/javac.html)
13:12cemerickOr, *it* wants you to do that
13:13@rhickeythis message just started to appear after updating Java on my machine
13:13@rhickeyi.e. build.xml hasn't changed
13:14cemerickrhickey: not sure what that indicates. I'm a long way from my ant days.
13:18cemerickrhickey: This may or may not help. Did you upgrade your ant install too? http://ant.1045680.n5.nabble.com/warning-includeantruntime-was-not-set-td2639463.html
13:40amalloywow, i just stepped into ##java for a minute since i have to do some java for work. i now appreciate how friendly #clojure is
13:40cemerickyeah, it's a swamp over there
13:40cemerickIn their defense, they're pretty constantly bombarded by complete nonsense.
13:41amalloyyeah, i can imagine
13:51zkimamalloy: man you weren't kidding, just seen: "sproingie: then WHAT is your fucking QUESTION?"
13:51amalloyyeah, i can understand being fed up with that guy though
13:53amalloywow, his program is surprisingly close to being correct given how clueless he makes himself sound
13:54zkimhah
13:55kumarshantanuhi, is it possible to get a list of all vars in a namespace? e.g. clojure.core
13:55zkimkumarshantanu: http://clojuredocs.org/clojure_core/clojure.core/ns-map
13:55cemerickkumarshantanu: see ns-interns
13:58kumarshantanuzkim: cemerick: thanks
14:00chouser,(dir clojure.set)
14:00dpritchettdon't forget ##javascript - that place is scary
14:00amalloychouser: clojurebot is down, sexpbot is working
14:01amalloydpritchett: *shudder* never will i ever. maybe i'll try #jquery if i have problems :P
14:02dpritchetti just discovered that clojure-mode had a new version when durandel.el invoked a nonexistent function - i googled it and wound up in clojure-mode.el. Is there a standard way to keep my elpa stuff up to date?
14:04dpritchetti would recommend #coffeescript if you want js help... just don't tell jashkenas i said so
14:05amalloynah, if i ever need js help it'll be with jquery *chuckle*
14:05zakwilsonparedit seems like a Good Thing in concept, but last time I tried using it, I found it difficult to get used to. Anyone here have opinions about whether it's worth it?
14:05amalloyzakwilson: everyone has opinions about it. they're not all the same
14:05zakwilsonamalloy: that tends to be the way of things when it comes to opinions
14:06amalloyi find it convenient, but i've only been using it for a month or two and sometimes i get frustrated cause i can't remember the keystroke for X
14:06mabeszakwilson: I think it is well worth it. It being able to move parens easily, and promote forms is a real time saver IMO
14:07amalloybut i'm definitely in love with M-<up>, M-(, and C-<right>. they're the ones i use all the time
14:07mabeszakwilson: I'm by no means a power user either, I just use the basics.
14:07dpritchetti would like paredit more if i knew basic emacs keyboard navigation I think... trying to figure out how to cut and paste something from outside of a sexp into said sexp was hard with no mouse
14:07dpritchettand i can't just move the parens manually
14:08mabesdpritchett: yeah, I've been using viper mode so I haven't even had to learn all the emacs bindings :) So far it has been pretty nice
14:08amalloydpritchett: C-<right> is good if they're adjacent already
14:10zakwilsonConceptually, paredit and slime seem to move code editing away from *text* editing and in to a mode of interacting with the *meaning* of the code more directly. It just seems to be a bit of a learning curve.
14:10dpritchetti tried really hard to like viper but it had this 1 second lag on exiting insert mode that just drove me batty
14:10dpritchetti like to think i just set it up wrong.... vim's instantaneous mode switching is key to getting some editor flow going
14:11dpritchettit's hard to walk away from the turtles-all-the-way-down magic of elisp though :(
14:15mrBlissIs it true that finger trees "lookup items in O(n)"? http://david-mcneil.com/post/1393750407/clojure-conj-day-1-notes (search for "lookup")
14:16chousermrBliss: looks like those notes got a few details mixed up.
14:17chouserdouble-list has amortized constant time for left and right ends, but the only access to the middle would be linear
14:17chousercounted-double-list can look up by index in O(log(n))
14:17zakwilsonI glanced through the PDF slides. It wasn't clear to me what finger trees are for.
14:18mrBlisswhat's the difference between the counted-double-list and the double-list (besides the faster look up times)?
14:19chouser:-(
14:20chousermrBliss: that's pretty much it. counted-double-lists give you fast lookup by index
14:20mrBlisswhat's the trade-off?
14:21amalloyzakwilson: my understanding is that finger trees are a generalized functional data structure, which make it easy to implement other data structures as special cases of finger trees
14:21chouseroh, time during insert/remove and total meory
14:21chousermemory
14:22mrBlisschouser: thanks for the info. Do you have any idea when they'll be ready?
14:22mrBliss*finished
14:22chousermrBliss: as soon as you've added the features you need.
14:22chouser:-D
14:24zakwilsonI asked this before, but we have some different people around now. I'm doing a bunch of map lookups in a very inner loop. The maps are a few hundred to a few thousand entries, and the purpose of the lookups is to find the common keys between one and the rest. Keys are strings. What, if any speed optimizations might be possible?
14:24mrBlisschouser: I was planning to look into them as soon as they're finished ;-)
14:26amalloychouser: what still needs work? i might be interested
14:27chouserzakwilson: off the top of my head, you might be able to get O(n) out of sorted-maps vs. what is probably O(n log(n))
14:27chouseramalloy: mostly just making sure they implement all the clojure.lang.PersistentCollection and java.util.Collection methods properly. I think mostly what's missing there are metadata, equality, hashing, that kind of thing.
14:28amalloyah, cool. sounds like i might not even need to learn how they work to help, then :)
14:30cemerickg
14:30defnwell hello everyone
14:31apgwozhello defn
14:31kumarshantanuanother question -- is it possible to defn a function like this -- (defn (quote (symbol "foo")) [] (println "foo")) ; getting error, but you know the intent
14:31apgwozkumarshantanu: what's the use case?
14:32kumarshantanutrying to defn functions (root binding)
14:32Rayneskumarshantanu: Not without a macro.
14:32RaynesOr eval, which is just bad juju.
14:32kumarshantanuany examples?
14:33chousersome options: macros, intern, alter-var-root
14:33RaynesOh yeah, intern.
14:33chouserkumarshantanu: but a clearer description of your specific use case would be helpful
14:35kumarshantanuI am trying to build functions prefixed with "not-" for things like map? vector? empty? nil? etc
14:35kumarshantanunot-map? --> #(not (map? %))
14:35chouser(complement map?) ?
14:36_na_ka_na_hello. I'm trying to add a helper macro which takes a protocol and uses its :sigs to emit a deftype, only problem is that the protocol seems not to be available at macroexpand time .. if I put the macro body inside a function it works as expected
14:36RaynesWhen you find yourself doing stuff like that, remember the comp function as well.
14:36Raynes(comp not map?)
14:36mabesalso, for the opposite of empty? you should use seq
14:37_na_ka_na_kumarshantanu: in addition to what everyone has said .. we have if-not, when-not
14:37cemerickmabes: a contestable point :-)
14:37kumarshantanuI am trying to put them in the root so that they can be available in other namespaces -- is that a correct assumption (is it possible)?
14:38kumarshantanuI am asserting a lot...so "not" prefixed would be handy really
14:38replacachouser: ahh, thanks. Maybe I'll just let web viewer miss out on that goodness. Are you going to push those syntax updates back to schacon?
14:39_na_ka_na_kumarshantanu: what do you mean by put them in the root?
14:39kumarshantanuroot binding, I meant
14:39chouserif (complement map?) and (comp not map?) are too long, please consider writing your own 'complement' with a name you like rather than mucking about in clojure.core namespace
14:40chouserreplaca: hm, I suppose I should.
14:41_na_ka_na_any ideas on how to write a helper macro which generates deftypes automatically given a protocol n some other args
14:42_na_ka_na_another option is using a reify to directly give instances at runtime
14:43_na_ka_na_inside a factory function
14:44replacachouser: one more way to get Clojure on the map :)
14:45amalloykumarshantanu: yeah, just this morning i was thinking it might be useful to (def ! complement), then you could eg (def not-map (! map?))
14:45chouser_na_ka_na_: you need a new class of some kind? you couldn't just generate arguments to a call to 'extend'?
14:45_na_ka_na_to give an example. (defprotocol P (foo...)) .. (helper-macro T [some params] P & some-args) => (deftype T [some params] P (foo ...))
14:46kumarshantanuamalloy: In fact I just want to write (not-map? x) instead of (not (map? x)) -- not-* is more readable
14:47amalloykumarshantanu: that's exactly what my def lets you do...?
14:47amalloyzakwilson: C-c C-c helps
14:47kumarshantanuintern seems to be doing it for me ---- (intern 'user 'foo (println "foo")) ; at the REPL
14:47kumarshantanuamalloy: yeah I need to defn some functions
14:48amalloykumarshantanu: no, you don't need to defn. you can just def them with complement
14:48kumarshantanuchouser: I won't use it if you suggest so :)
14:48_na_ka_na_chouser: you mean (deftype T [some params]) .. (extend T P {:foo ..}) ?
14:48chouserkumarshantanu: please consider something like (! map?) or (not! map?) instead of generating vars
14:49amalloy(def not-map (complement map?)) is the same as (defn not-map [x] (not (map? x)))
14:49kumarshantanuamalloy: yes, right...def slipped my mind for a moment
14:50_na_ka_na_but I think kumar wants not- to be available in all nses like it was in clojure.core if I understand correctly
14:50chouser_na_ka_na_: yes. perhaps (apply extend (helper-fn T [some params] P & some-args))
14:50Raynesamalloy: Dude.
14:50kumarshantanuchouser: okay...I am fine with (defn not-map? [x] (not (map? x))) ; not-* looks more readable
14:50zakwilsonchouser: quick and dirty test with sorted maps reveals it to be 25% slower that way.
14:51amalloyRaynes: yeah?
14:51Raynesamalloy: Couldn't you have left a "I didn't test this" note in your pull request somewhere? :p
14:51chouserzakwilson: you're walking both sorted maps in a O(n) way?
14:51_na_ka_na_chouser: yes that. extend is used at top-level like that ?
14:52chouser_na_ka_na_: yes, and is a function not a macro, so more composable and allows you to create things that are themselves more composable
14:52amalloyRaynes: sorry. left one last time; this time i either forgot or figured you'd remember i wasn't set up for testing
14:52Raynesamalloy: :p
14:52_na_ka_na_chouser: thanks again!
14:53amalloywhat's broken? i did test that it generated reasonable-looking strings
14:53chouser_na_ka_na_: if you actually need your function to genearte a new class on the fly, reify might useful. Not sure.
14:54_na_ka_na_chouser: yes both options have their place
14:55amalloyRaynes: um. okay that's kinda an embarrassing commit error. format-time needs another )
14:55RaynesIndeed.
14:55Raynes;)
14:55zakwilsonchouser: I'm extracting the keys from one and looking it up in all the others using the functions intersection and difference, defined here: http://github.com/zakwilson/zutil-clj/blob/master/map.clj
14:56zakwilsonSo I guess what I'm really asking is: are these definitions of intersection and difference optimal?
14:56amalloyfeel free to amend my commit so that it looks like i never sent that :P
14:57chouserI mean something like (let [o (reify)] (apply extend (class o) (helper-fn ...)))
14:59jweissis there a recommended alternative to deliberately capturing a scoped variable in a macro? i want to generate a fn that closes over that variable
14:59defnchouser: finish reading lisp : the good parts yet? ;)
15:01chouserdefn: no, but well on my way to converting to PDF to be loaded on my book-reading device of choice.
15:02_na_ka_na_chouser: how is that better than just (reify Proto ...) ?
15:02defnnice :)
15:03chouserzakwilson: my point was that if you require the input maps be sorted by the same comparator, you could walk them both in step, generating your intersection in O(n) time
15:03chouserpossibly more complex code, but the time cost would increase more slowly
15:04chouser_na_ka_na_: reify is a macro, so generating args to it has to happen at compile time forcing your helper to also be a macro and therefore get *its* args at compile time
15:05chouser_na_ka_na_: what I showed would allow your helper to be a fn and talk all it's input at runtime, as late as you'd like.
15:09zakwilsonchouser: I may just be a little slow, but won't that fail comparing {"a" 1 "c" 3 "e " 5} with {"a" 1 "b" 2 "d" 4 "e" 5} (because it would either walk the whole thing or revert to a normal map lookup to see that "c" isn't there, and either walk until it finds "e" or revert to a normal map lookup)?
15:11chouserzakwilson: I may not be thinking about it deeply enough yet, but I do think you'd have to only advance the cursor that's farther behind.
15:15zakwilsonchouser: I think you may be right and I may be thinking about things incorrectly. I will try writing it.
15:15AWizzArdchouser: which things were drilled into your head at the conj?
15:16chousersimple == "not compound", avoid macros, seek composable abstractions
15:16chouserthere, now nobody has to regret missing it.
15:17pbuckleychouser: haha :-)
15:17pbuckley"the conj in 8 words"
15:18pbuckleybut you left out hammock :-)
15:18zakwilsonAre there videos from the conj?
15:18chouserpbuckley: that's a sub-point under "seek" :-)
15:18pbuckleyzakwilson: they took video, but getting it edited and ready/posted might take some time
15:18AWizzArdchouser: what do you mean by “simple == "not compound"”?
15:19zakwilsonpbuckley: that's to be expected.
15:19chouserAWizzArd: stuarthalloway asserted that "not compound" is the definition of "simple"
15:22_na_ka_na_chouser: but "not compound" is itself compound :P
15:22chouserheh. not a simple definition.
15:22chouseris there a function to get the comparator of a sorted thing?
15:23AWizzArdunfortunately not
15:23Raynes$dict simple
15:23sexpbotRaynes: adjective: Single; not complex; not infolded or entangled; uncombined; not compounded; not blended with something else; not complicated
15:23AWizzArdchouser: I wished FingerTrees would allow this.
15:24chouserAWizzArd: everything you customize a finger-tree with can be extracted later, I believe
15:28alexykhey everybody! back in the virtual world, but it will never be the same again. I know what everybody else looks like and where he or she lives! Astonishingly, there were a few "she"s!
15:28_na_ka_na_chouser: continuing the reify talk .. assuming that let is at the top level, how do I extract the class to form more instances?
15:28chouserzakwilson: I have a sorted-intersection-with that seems to work. Should be O(n+m), worst case, but I haven't tested the performance at all.
15:28mefestoalexyk: great lightning talk! :)
15:28alexykmefesto: thx!
15:28chouser_na_ka_na_: hm, you want more instances...
15:29_na_ka_na_chouser: for only one instance I could just create a helper factory fn containing reify ?
15:29_na_ka_na_w/o extend
15:30alexykchouser: in case you were left wondering, why I greeted your button with a promise to keep using cake, I have an explanation! :)
15:30zakwilsonchouser: link/pastebin/etc?
15:30chouser_na_ka_na_: I'm trying not to recommend anything, just make you aware of options. I usually bad at doing the latter without doing the former.
15:30chouserzakwilson: you want it? Would hate to cheat you of the opportunity.
15:31chouser_na_ka_na_: if you want multiple instances of the same class, perhaps you could create the type first, then pass that class to a helper fn to generate the fns map that would be used by extend.
15:31_na_ka_na_chouser: in #clojure, its too late for you to not recommend anything, everything you say is "chouser branded" :P
15:31_na_ka_na_chouser: in clojure irc, its too late for you to not recommend anything, everything you say is "chouser branded" :P
15:31zakwilsonchouser: I have the algorithm in my head already, so I don't think I'd learn much by writing it myself. That aside, your code is probably prettier than mine, so I'll improve by reading it.
15:31chousernoooo
15:32chouser_na_ka_na_: your blog is full of things that blow me away. I really must refrain from coaching you!
15:33apgwozchouser: i have a patch for contrib.command-line, what's the best way to submit it-- to you directly? pull request on github clojure/clojure-contrib project?
15:33_na_ka_na_chouser: that is exactly my plan :)
15:33angermanhow would I transform keys in a hashmap?
15:34_na_ka_na_chouser: my blog?! I think you are mistaking me for someone else
15:34replacaapgwoz: put a bug on assembla with a patch
15:34apgwozreplaca: ok. cool
15:34raekangerman: (zipmap (map ... (keys m)) (vals m))
15:34angermane.g. I have a fucntion scaler: key -> key that I want to apply to all keys
15:35replacaapgwoz: make sure you have a CA in and then follow the instructions here: http://clojure.org/patches
15:35chouser_na_ka_na_: ah, perhaps indeed. I was thinking of nakkaya.com.
15:36chouserzakwilson: http://gist.github.com/645575
15:37apgwozreplaca: I've signed the CA, though my membership to clojure-dev is still pending, thus I can't request assembla contributor role. though is that for naught anyway, given the eventual switch?
15:37zakwilsonchouser: thanks
15:38amalloyclojurebot: ping?
15:40replacaapgwoz: good question. I would just put a bump request on the clojure-dev list. Stuart should give you rights. I don't think they've gotten to the actual issue migration yet.
15:40apgwozreplaca: i can't post to clojure-dev :)
15:41apgwozregardless, thanks for the help
15:41Raynesalexyk: That was sexpbot.
15:42Raynesclojurebot was passed out behind the stage.
15:42alexykRaynes: aha! BTW, I missed meeting hiredman. :( What did you look like, hiredman?
15:42replacahmm, you should be able to request that too. :)
15:42alexykRaynes: clojurebot misinterpreted the sex in sexpbot
15:42apgwozreplaca: i did, a couple of weeks ago. never got processed apparently
15:42Raynesalexyk: Like David Liebke with uglier facial hair.
15:43Raynes;)
15:43alexykRaynes: fewer of those?
15:43replacahmmm...
15:43RaynesHe was standing in front of me talking to danlarkin and friends.
15:43alexykRaynes: yeah, as if I could remember who stood there! I got an extra white ticket for that!
15:43danlarkinfrienddddddddds!!!!!!
15:43chouserapgwoz: it's best to get some input on a patch too, before submitting. I'm no longer reading all g.group messages, but posting there is always good
15:44alexykquoting Raynes, you guys are my best fwends <3
15:44apgwozchouser: yeah, i will certainly do that once I get access.
15:44angermanhow would I go about writing a "peak"/"valley" detector on a histogram?
15:44apgwozchouser: for some reason I was thinking /patches applied only to clojure core, which of course is wrong. :)
15:44chouserapgwoz: just the regular clojure g.group is fine. Here, all I'll add a thing that flags me if the message contains "chouser"
15:45alexykangerman: partition by two, replace by the sign of the difference
15:45angermanI assume i could move a window with take/drop along the keys of the histogram and check if (max vals ...) == val for key, but that sounds somewhat stupid.
15:45raekapgwoz: is there an issue for the bug/enhancement? if not, you can create one while only being a watcher...
15:45angermanalexyk: it needs to be a bit more robust.
15:45angermanalexyk: the data is not very smooth :(
15:45alexykangerman: partition by the function > or <
15:46alexykwith a threshold
15:46alexykie > by 3
15:46apgwozraek: oh. under support. interesting.
15:46apgwozraek: i was looking only in "tickets" which doesn't have a "new ticket" button anywhere.
15:47raekalso, if you create an account, make sure to use a username that is your real name
15:48alexykangerman: http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/partition-by
15:49danlarkinangerman sounds like hiredman's alternate personality
15:49chousercemerick: I can probably help with contrib build gruntwork, but I'm in no position to lead or make decisions there. Strikes me as right up your alley :-)
15:49angermanalexyk: that sounds like a good idea I'm still wondering how I'd keep it local. e.g. make sure to only have a window of +-10 datapoints.
15:49angermandanlarkin: sorry to disappoint you :p
15:49alexykdanlarkin: angerman is a fired hiredman!
15:49alexykoh, that's disgruntledman
15:51defnheh
15:51defnhomicidalman
15:51alexykhey defn! you've made it out of the clutches of RDU!
15:51defnjust barely! :)
15:52defnyet another late night on Saturday. Just got into work at 2:30pm
15:52alexykdefn: ALl American Food almost detained me too
15:52defnhaha -- luckily i had chouser to keep me awake while I waited to board
15:52alexykbefore that, that guy Hohn from DC poured us all on the shuttle some godo whisly from a bottle. Now that's hwo conferences are done.
15:52alexykJohn
15:53alexykwho knows John from DC? what's his nick? that guy is my hero now
15:53alexykhe was there with Alex, they are from some government contractor or other; or Maryland, perhaps
15:54alexyknext time, gotta take a flask to the conj, I'll get those cgrand's slides the instant I see them!
15:54_fogus_alexyk: I know him.
15:54alexyk_fogus_: cool! does he have a Twitter?
15:54_fogus_good dude
15:54defnback to work
15:55defnill be around later, ciao
15:55alexykdefn: later
15:55pbuckleyalexyk: I don't know his nick on IRC, but he's @sirlyric on twitter
15:55alexykpbuckley: ah ok, saw him there
15:55alexykpbuckley: don't you find NH weather a letdown after NC?
15:56pbuckleyalexyk: yeah a bit colder - it was warmer outside at night in NC that it is inside my house
15:56_fogus_that's the one! Was trying hard to remember his twitter id. People should avoid handles for my convenience. :p
15:56alexykpbuckley: I flew through Philly and it was 70 there. Just rain here. But programming is so much better in the rain!
15:57alexyk_fogus_: at least we learned you really don't have horns!
15:57angermanhmm. adding to the tail of a list is just not easy :(
15:57alexykangerman: keep adding to the front, then revert the result :)
15:58angermanyea.
15:58chouserok, putting "chouser" in a message to the clojure user's g.group should be more visible to me now than others. Recommended for anyone wanting me to take a patch for something. :-)
15:58raekangerman: you can append to the back of a vector, then run seq on it
15:59raek,(loop [x 10, acc []] (if (zero? x) (seq acc) (recur (dec x) (conj acc x))))
16:00raek->(loop [x 10, acc []] (if (zero? x) (seq acc) (recur (dec x) (conj acc x))))
16:00sexpbot⟹ (10 9 8 7 6 5 4 3 2 1)
16:00tonyl->(range 10 1 -1)
16:00sexpbot⟹ (10 9 8 7 6 5 4 3 2)
16:00tonyl->(range 10 0 -1)
16:00sexpbot⟹ (10 9 8 7 6 5 4 3 2 1)
16:01angermandamn i ran out of mem ... now emacs hangs
16:03chaslemleyhey guys, recently started using clojure solving euler problems and wanted to write something more non-trivial so I worked on this over the weekend, for parsing a haml type html template: https://gist.github.com/2964d548027eb63c19d7
16:04chaslemleybased on a ruby gem a friend of mine has built
16:04chaslemleyi was just wondering if there's any use for something like this to interface with compojure or if it's overkill, already been done, etc
16:08pbuckleychaslemley: I don't know the answers to your questions, but I think it's a cool idea.
16:09alexyk_fogus_: just found out you interviewed Odersky! Are you a secret Scalaist? :)
16:09chaslemleycool, thanks
16:10_fogus_alexyk: I wouldn't say secret no.
16:10alexyk_fogus_: man, you even got Harrop there! awesome
16:11apgwozchouser: you should perhaps get your first message tagged chouser in a second or two
16:11_fogus_alexyk: I don't know who that is... but he keeps coming back to comment.
16:11alexyk_fogus_: if you don't know who Jon Harrop is, you don't know Haskell or F# :)
16:11lrennor comp.lang.lsip
16:11AWizzArdstuart wrote in the GG “code path for using vars is now *much* faster for the common case” — what is meant by “code path”?
16:11raekIs there any fuzz testing lib for clojure?
16:12AWizzArdregarding 1.3 Alpha 2
16:12alexyk_fogus_: and you might as well keep it that way for your peace of mind :)
16:12_fogus_alexyk: I guess I need to read more about Haskell then.
16:12alexykhe'll be surpsrised by your mildmannered replies :)
16:13alexyk_fogus_: he is the bane of Haskell and Lisp! And apparently Scala too
16:14_fogus_alexyk: Oh... I think I see now.
16:14chouserapgwoz: It worked. :-) I'll take a look, but I'm beginning to think the design of contrib.command-line is too ...um... compound.
16:14chouserit shouldn't require a patch to add validation
16:18apgwozchouser: yes, it is a bit difficult.
16:18apgwozand not that friendly.
16:18apgwozi do like the simplistic format of the spec though.
16:19raekI'm a bit puzzled regarding how to solve "the error problem". I have a function that parses a string into a map. not all strings are syntactically valid. what should the parse function do when it encounters an invalid string.
16:19Raynes_fogus_: The only thing you need to know about Jon Harrop is that HASKELL SUCKS F# AWESOME YAY!1!!1!
16:19raekmy options seems to be: 1. pre/post-conditions 2. returning nil 3. throwing some exception
16:20raekor maybe 4. calling *syntax-error*, which the user would have to rebind
16:20_fogus_Raynes: So you're saying I should abandon learning Haskell? ;-)
16:21RaynesIn his humble opinion YES AND EVERYTHING ELSE LEARN F# YAY!1!!1!
16:21chouserraek: sounds about right.
16:21raekso, dear #clojure. how do you do error reporting?
16:22alexykraek: (throw (Exception. "arrgh!"))
16:22chouserraek: you could bind *syntax-error* to a fn that throws an exception, then call it in your parser and do something useful with the return value
16:23rdeshpandewell, i can't really speak for how to do this in clojure, but i would typically return some sort of symbol that corresponds to a key in a translation file (maybe a yaml) that has the readable, localized error message
16:23chouserthis would default to Java-style expection-throwing, but allow a sufficiently concerned user to control the behavior and avoid losing the rest of the parsing if they so desired.
16:30raekchouser: thanks for the suggestions. :) the binding + fallback to exception way does have a clojurey feel to it, i think...
16:32raekalso, the defdynamic thingy is in Clojure 1.3.x, right?
16:33chouserraek: ^:dynamic, but yes 1.3 alpha 2
16:33chouserraek: for the exception to throw by default, consider clojure.contrib.condition. It may not be worth the dep, but might be worth considering.
16:35zakwilsonchouser: I couldn't plug your sorted-intersection-with directly in to my code, but I tried it with some extracted data. It's about 10x slower.
16:35chouserheh. nice.
16:36nickikman do i wait for the videos don't really get all that new stuff
16:37danlarkincontrib.condition is nice
16:38chouserhave you guys added your features to contrib yet, or still keeping them to yourselves?
16:38chousercontrib.condition features, I mean.
16:39danlarkinI think we have a patch up on assembla?
16:39danlarkinOh, or maybe Steve already committed them
16:40cemerickchouser: Thanks. I sorta did a facepalm as I read Stu's initial email. Any expertise I have in that alley is much to my chagrin, really. :-)
16:41chousercemerick: yeah, I know.
16:41chouserbut there it is
16:41technomancybuild conscription. =)
16:41chousermaybe you can talk the other stu into it instead
16:42cemerickchouser: after his drawn-out battle over the modularization of old-world contrib, I couldn't in good conscience ask him to lead it.
16:42cemericktechnomancy: watch it, I may start throwing feature requests at you ;-)
16:43chousertechnomancy: or you! I'd be happy to be required to use your One True Build Tool in exchange for having someone sanely manage contrib builds.
16:44technomancyis this from a specific mailing list thread or just general "how are we going to do this" discussion?
16:44chouserI already wrote my own pom.xml for finger trees because I thought it was what was required. I'll clearly go to any length, if only they'll tell me what to do.
16:44amalloychouser: One True Build System? it looked like you were struggling to find an OTBS there
16:45technomancyif it's just a matter of getting hudson to deploy locally to build.clojure.org I can help
16:45technomancyI don't know the first thing about archiva/nexus though
16:46cemerickThe local-install-to-repo thing is decidedly not the right thing to do.
16:48kevinsis there way to stop the repl without killing it? (i.e. runaway function). This is especially bad in netbeans/enclojure where I currently have to stop the entire IDE.
16:49cemerickkevins: No. This will improve to some extent as more people adopt nrepl, which supports evaluation interrupts.
16:49technomancymaybe once a nexus is set up I could help getting some of the projects pointed at it
16:49kevinsthanks.
16:57amalloydo we have an iterate-while construct? i often find myself wanting (take-while f (iterate g x))
17:01apgwozcemerick: with nrepl, has anyone discussed porting SLIME to use it, or creating a new mode for use with it?
17:01apgwoz(obviously in emacs)
17:02technomancyapgwoz: it will probably happen eventually
17:03technomancynobody has volunteered yet. =)
17:03apgwoztechnomancy: i think it might be beyond my elisp skills...
17:03apgwozthough, maybe not... i don't know :)
17:04rata_hi
17:04arbschtapgwoz: the other way seems easier: write a clojure-side adapter like swank-clojure but for nrepl
17:05chouserkevins, cemerick: see 'clojure.contrib.repl-utils/add-break-thread!' to make Ctrl-C interrupt runaway tasks in the current thread.
17:05apgwozarbscht: i suppose interpretting the swank protocol would be easier
17:06apgwozthough, that sort of bastardizes nrepl, don't you think?
17:07chouserok, finger-tree slides are up at http://talk-finger-tree.heroku.com/ in a format that doesn't require downloading a giant PDF.
17:07apgwozotherwise, nREPL should just implement SWANK and be done.
17:07cemerickchouser: There's no way to send a Ctrl-C in enclojure or ccw, AFAIK
17:07apgwozchouser: oooh, smooth transitions!
17:07chousercemerick: oh, sure.
17:08RaynesIsn't there something in Clojure to get the line separator for the system you're on?
17:08chousercemerick: those who live by fancy tools may sometimes die by them. :-)
17:08amalloy(System/getProperty "line.separator") as i recall
17:08RaynesI know the Java way, but I thought I remembered something in Clojure itself.
17:08RaynesI might be mistaken.
17:09muhdik_is clojure any good?
17:09RaynesIt's all sorts of good!
17:09mabesmuhdik_: this group might be biased ;)
17:09apgwozRaynes: (def line-seperator #(System/getProperty "line.separator")) ? :)
17:09amalloymuhdik_: nah. we just like hanging out here...
17:09arbschtapgwoz: implementing swank isn't the easiest thing to do; the protocol is unstable, and often assumes a CL runtime (or at least a CL reader). it'd be wise to isolate swank-fu in a module like an adapter than to build nrepl around it
17:09muhdik_u can make anything that you can with java in clojure i mean?
17:09Raynesapgwoz: Read above.
17:10apgwozRaynes: i know, my comment was in response to your "I know the java way"
17:10apgwoz.. and was a joke :)
17:10RaynesOh. I'm too ill to get jokes.
17:10muhdik_or not?
17:10chousermuhdik_: pretty much anything worth making, anyway. :-)
17:10apgwozRaynes: oh, sorry you're ill :(
17:10amalloymuhdik_: yes, you have access to everything java has, if you need it
17:10Raynes$wiki turing completeness
17:10sexpbotFirst out of 1040 results is: Turing completeness - Wikipedia, the free encyclopedia
17:10sexpbothttp://en.wikipedia.org/wiki/Turing_completeness
17:10muhdik_oh so u can make webpages?
17:10apgwozarbscht: right, swank is complicated, which is why I'm asking why it makes sense to bastardize nREPL with a SWANK interpreter
17:11muhdik_i mean ecommerce
17:11apgwozarbscht: well, a SWANK to nREPL interpreter of course
17:11muhdik_is it?
17:11muhdik_hmmm
17:11arbschtapgwoz: for SLIME compatibility. SLIME has the same problem as swank, only on a larger scale. it seems to me that it makes less sense to reimplement a SLIME-like than a swank adapter
17:12raekmuhdik_: there are web frameworks, so yes
17:12muhdik_i mean does oracle own clojure?
17:12apgwozarbscht: while it's more work, it probably does make sense, given that you no longer have to make special cases. nREPL is to clojure as SLIME/SWANK would be for CL.
17:12muhdik_or just java
17:12muhdik_because oracle doesnt have a clue
17:13raekoracle does not own clojure, rich hickey and the contributors do
17:13apgwozarbscht: no one is saying the nREPL mode wouldn't be influenced (heavily) by SLIME...
17:13muhdik_ok cool
17:13arbschtapgwoz: well, nrepl is to clojure what swank is to CL. there's no SLIME-like in nrepl. but if it makes sense to you to build one, go ahead, I'd use it. :)
17:13muhdik_is clojure the same as f# in the .net world?
17:14raekI would say that F# and Scala are more similar
17:14zakwilsonmuhdik_: I think Scala is more limilar
17:14zakwilsonsimilar
17:14muhdik_clojure is like linq then?
17:14chouserthe .net equivalent of Clojure is ClojureCLR
17:14apgwozarbscht: right. at some point in time, i might be willing to attempt to take on that project... but unfortunately not now.
17:14muhdik_ok
17:16apgwozarbscht: of course in my previous statement with the analogy, it should have been nREPL-mode/nREPL for maximum correctness.
17:16arbschtapgwoz: I understand
17:17apgwozarbscht: ok. just clarifying :)
17:17cemerickchouser: sure, sometimes; though, you can s/fancy/"simple" there, too. ;-)
17:18chouserso true
17:18chouserwhich reduces to something like "no tool is perfect". go figure.
17:19jweissi'm trying to call apache xmlrpcclient that has 2 overloads for .execute: String,Object... and String,List. i am passing in a clojure vector so i thought it'd hit the latter, but seems to be hitting the former. type hinting as java.util.List didn't help. any suggestion?
17:20chouser->(instance? java.util.List [])
17:20sexpbotjava.lang.NullPointerException
17:20fhdHi
17:21fhdIs there something like reify that I can use to extend classes?
17:21fhdreify and deftype do apparently only work with interfaces
17:22replacafhd: You have to use gen-class
17:22chouserfhd: proxy
17:22jweisschouser: not sure what the result of that sexpbot experiment should tell me
17:22replacachouser: does proxy support extending?
17:23chouserreplaca: yessir
17:23fhdchouser: Cool, I'll try that :)
17:23replacaHah, of course! That's what I use in pprint :)
17:23chouserjweiss: yeah, me either. :-P Maybe you'd better paste your code somewhere. hinting to List should do it
17:23replacayou taught me two years ago, but I haven't done it since
17:26jweisschouser: http://gist.github.com/645803
17:27jweissoops i typo'd List->list but i had it right before and still didn't work
17:27fhdchouser: Works, thanks :) A bit confusing though that there is deftype, proxy, reify (and I guess a few others)
17:27chouserreplaca: :-)
17:29chouserfhd: yeah. and worse that the proxy syntax is rather different
17:30fhdBy the way, can I watch the clojureconj talks online?
17:30RaynesHow would one pprint a map with newlines inserted in the appropriate places? The default is to print it all on one line with commas separating key -> value pairs.
17:30fhdI heard rumours they'd be recorded
17:30technomancyfhd: it'll be a few weeks at least
17:30petrillifhd - hopefully. I'd like to watch them again, even though I was there.
17:30fhdtechnomancy: Damn, I was really looking forward to this :(
17:31petrilliAlso, I'd like a replay of Rich talking about pods at the BBQ... so I can listen to it 50 times to understand it hopefully.
17:32fhdThen again, it takes weeks until the talks are uploaded for most conferences I follow
17:32technomancypetrilli: well the emerginglangs talk will cover that
17:32fhdDon't really know why, is the world of video recording that unrestrainable?
17:32dnolenRaynes: pprint is useful for that.
17:32petrillitechnomancy: awesome... I thought I got it, then had another beer, went ot sleep and woke up confused.
17:32Raynesdnolen: Indeed, I'm asking how one would use pprint to do the above.
17:33Raynesdnolen: The docs are kind of a brick wall.
17:33Raynestechnomancy: I'm disappointed that I never got to meet you at the Conj. I just admired you from a distance. <3
17:34petrilliI'm still trying to figure out if he types standing up.
17:34pjstadighe does
17:34petrilliWow... I thought I was hardcore with a desk that raises up so I can type standing up, but I still use a Model M
17:35chouserfhd: & args would make args a seq not a vector
17:36chouserhm, but that should still implement java.util.List.
17:37drewrpetrilli: I almost pulled out my phone to record it
17:39technomancyModel Ms are the best, modulo RSI concerns. if I could get a split one I would be all over it.
17:40petrillitechnomancy: Email Unicomp... I did. They own all the patents, and also all the tooling to build it. If they knew they could sell enough, I'm sure they would.
17:40fhdK, gotta run. cya!
17:41petrillitechnomancy: sales@pckeyboard.com
17:43technomancyRaynes: it was all a blur; so much going on.
17:43nDuffhttp://elitekeyboards.com/products.php?sub=filco_keyboards,majestouch_104key
17:44jackdempseyfunny, i was reading about this today
17:44jackdempseymy msoft natural elite 4000 is still the only piece of msoft shit i use
17:44petrilliFor me, nothing will ever trump the buckling spring keys in the IBM and Unicomp keyboards.... I type 30-40% faster. And thanks to Clojure, I've not worn out the shift key yet
17:45nDuffpetrilli, these also use real mechanical switches; they are indeed a thing of beauty.
17:46petrillinDuff: Cool. I'd need to check one out... if I ever wear this one out... my original, circa 1990 Model M still works
17:47petrilliNow I just need to find somewhere that doesn't think saying that "we have a fully integrated SOA architecture" is actually useful.
17:49apgwozwhen using clojure.contrib.socket-server, is there a way to get details (i.e. for logging) such as the client's ip address?
17:54apgwozfrom within the the handler that is.
17:58apgwoz... it certainly doesn't look like it via the source, but someone might have a thought on the matter? is it a doomed thought?
18:00lazy1apgwoz: The server object has :connections, my guess you can use that somehow
18:02apgwozlazy1: there's no guarantee that the last conjed element is for the thread that just started.
18:02apgwozso, while it'd potentially work, it'd be buggy
18:02jweissso if a java method take varargs and i want to create a clojure method that calls it with however many args are in a list (NOT the list itself, that's just one arg), what do i do? there's no apply for java methods. and i can't use macro because i need to evaluate the form that creates the list
18:03jweisssorry create clojure fn
18:03apgwozjweiss: supply an array as the last argument. a java array
18:03jweissapgwoz: yeah i tried that, somehow the lib i'm calling doesn't like it
18:04lazy1apgwoz: You're right, however there might be something in the connection object you can use (maybe compare input-streams). But my guess it's a dead end
18:04apgwozlazy1: yeah, we're already getting hacky when we start comparing input streams :)
18:05lazy1apgwoz: Switch to aleph? (maybe, not sure if it will give you what you need)
18:06apgwozlazy1: yeah, i don't want async, which is why server-socket is perfect. if only the functions in server_socket.clj weren't private, then i'd write a new create-server.
18:07apgwozprivacy is a double edged sword.
18:09apgwozI think I'm write here, defn- functions can't be exported at all outside of the namespace they were defined in right? It's not just left out of the default namespace, correct?
18:09apgwoz(by default namespace, i mean, the default exports, like you'd get when you (use 'lib))
18:12lazy1apgwoz: IMO the shortest path is to copy the code and change accept-fn to pass the socket object as well)
18:13apgwozlazy1: yeah, I agree. it's certainly not ideal though.
18:30AWizzArdhttp://java.sun.com/docs/white/langenv/Simple.doc2.html <-- I love point 2.2.4 :-)
18:32AWizzArd“Object oriented programming supersedes functional […] style.”
18:33plathropHow do I write java code that runs as a daemon?
18:33Adamantnow I know why I hate Java so much
18:33plathrops/java/clojure/
18:33sexpbot<plathrop> How do I write clojure code that runs as a daemon?
18:34plathropI've seen lein-daemon, but I'm not sure that's right for running on a production box
18:34nDuffplathrop, ...use a process supervision tool to run your arbitrary foreground process in the background!
18:34plathropnDuff: That's an option I'd prefer to avoid. I'm an Ops guy who has bitched incessantly about devs who do that :-P
18:35nDuffplathrop, I'm an ops guy and I _hate_ developers who write things to only be usable as daemons.
18:35nDuffplathrop, daemontools or runit gives you status monitoring, automatic restarts, a consistent control interface...
18:36nDuffplathrop, ...ability to run triggering events on shutdown or prior to restart (ie. automated cleanup)
18:36plathropWhereas I like things that fit in to the OS properly and run as real daemons. I like the *option* to run in foreground, but I want the program to be able to be a daemon too
18:36nDuffplathrop, ...ability to record the signal that caused your exit or the exit status...
18:37plathropAll valid points
18:37nDuffplathrop, "real daemons" are an anachronism, and modern operating systems are moving away from them; look at the movement towards Upstart.
18:39plathropAnd who watches your watchdog daemon?
18:39nDuffplathrop, my watchdog daemon either _is_ my init (PID 1) process, or is directly supervised by it.
18:43plathropI guess I'll look at wrapping apache-commmons daemon for my purposes. Thanks
18:53LLLLOll
18:58LLLLOf
19:03LLLLO!time
19:03LLLLO!time
19:04LLLLO!time
19:09LLLLO!time
19:09TheAnimalLLLLO: 26.10.2010 01:10:23 +0200
19:13amalloydamn. someone tell that boy to use a test channel
19:18amalloy->(take 2 [1])
19:18sexpbot⟹ (1)
19:20KirinDaveSometimes it's the best feeling in the world to use gen-class
19:20amalloy->(->>[nil nil 1 nil nil] (drop-while nil?) (take 2) (keep identity))
19:20sexpbotjava.lang.SecurityException: Code did not pass sandbox guidelines: (#'clojure.core/keep)
19:20amalloy,(->>[nil nil 1 nil nil] (drop-while nil?) (take 2) (keep identity))
19:20KirinDaveAnd be like, "Dear other jvm languages, you can suck what I am giving you. If you don't want to get slapped around, I suggest you enjoy it."
19:21amalloyargh both of the bots hate me
19:21amalloy,(->>[nil nil 1 nil nil] (drop-while nil?) (take 2) (filter identity))
19:21amalloy->(->>[nil nil 1 nil nil] (drop-while nil?) (take 2) (filter identity))
19:21sexpbot⟹ (1)
19:22hsuhwas clojureconj recorded?
19:22jackdempseyhsuh: evidently yes, and videos potentially in weeks or more
19:25plathropHow do you implement signal handling in clojure?
19:25KirinDaveplathrop: Like, UNIX signal handling?
19:25plathropnDuff: So, if you are using a watchdog process, how do you make it so the watchdog process can nicely stop your service?
19:26plathropKirinDave: yeah. I have clojure I want to run as a daemon. If I run it under upstart it will be sent a TERM segnal
19:26plathropI need to make sure I clean up and exit nicely
19:26KirinDaveplathrop: Ha.
19:26KirinDaveplathrop: Find someone who's done that work over the jni.
19:26KirinDaveThat's the only realw ay
19:27plathropoh dear
19:27plathropNobody is running clojure as unix daemons then?
19:27nDuffplathrop, it depends; runit _does_ allow you to override event handlers, so you can provide a command to be run in place of a SIGTERM
19:27nDuffplathrop, ...and that command can use whatever your preferred polite-shutdown-method may be.
19:28plathropnDuff: how can that command access the internals of the service though?
19:28KirinDaveplathrop: As much as they are java.
19:29KirinDaveplathrop: There are still a lot of green pastures.
19:29arohnerplathrop: check out lein-daemon
19:30nDuffplathrop, that's your implementation decision. Tomcat uses a command socket; I'm trying to remember the standard-ish approach that we used two jobs ago, but it's escaping me without some (ongoing) googling.
19:30plathroparohner: yeah, I'm looking at it. thanks
19:31nDuffahh -- it was a JMX command-line tool
19:31nDuff...that we had our control scripts invoking.
19:32plathropnDuff: oh, okay. that seems like adding a lot of complexity just for the luxury of not using an init script? I'm not trying to be a dick I'm really trying to understand the right way to do this.
19:32plathrop(I say since I've already been flamed to a crisp elsewhere for trying to figure out why you'd want to use a watchdog program)
19:33nDuffplathrop, *shrug*. At that time, I was sysops staff, _not_ java dev staff. Using JMX shifted a lot of pain from the ops team onto the java team.
19:34nDuffplathrop, ...maintaining a separate init script for every distro which happens to interpret the LSB's standards for how they should behave a little bit differently is Really Not Fun, by the way.
19:35nDuffwell, not that much pain, as the Java folks were already supporting JMX anyhow
19:35nDuffso it was really saving labor all 'round
19:36plathrophuh. okay
19:36plathropAt this point this is sounding like way more of a project than I bargained for for something as simple as I'm working on
21:04amalloyargh i hate mutable state. please let me work in clojure instead of java
21:10rata_amalloy, I sympathize with you. mutable state is hateable
21:30TeXnomancymmm... new lein plugin task uses juxt
21:30TeXnomancythank you trptcolin, wherever you may be.
21:30TeXnomancyand ivey =)
21:30TeXnomancyit's a little-known fact that I can't reject a patch that includes a call to juxt.
21:30iveyheh
21:31iveythat's all trtpcolin. I just merged the thing.
21:31iveyHowever, that's good to know about juxt...
21:34amalloy,(((juxt juxt juxt) juxt juxt) juxt juxt juxt juxt)
21:34clojurebotjava.lang.IllegalArgumentException: Wrong number of args (4) passed to: PersistentVector
21:34amalloyaww what
21:34ivey->(buffalo buffalo buffalo buffalo)
21:34sexpbotjava.lang.Exception: Unable to resolve symbol: buffalo in this context
21:34amalloy,((juxt juxt juxt) juxt juxt juxt juxt)
21:34clojurebot[#<core$juxt$fn__3665 clojure.core$juxt$fn__3665@4218cb> #<core$juxt$fn__3665 clojure.core$juxt$fn__3665@169c6f2>]
21:35TeXnomancy~o/
21:35clojurebot\o ... High five!
21:35amalloy,(apply ((juxt juxt juxt) juxt juxt) juxt juxt juxt juxt)
21:35clojurebotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.core$juxt
21:35amalloybah, i give up
21:35amalloybut i love the high five
21:36TeXnomancy((malkovich malkovich malkovich) malkovich malkovich)
21:37trptcolinoh wow, sorry for apparently indirectly starting this :) (just got caught up on the juxt conversation)
21:38iveytrptcolin: buffalo
21:38trptcolindoh!
21:39rata_,(((juxt juxt juxt) juxt juxt) [juxt juxt] [juxt juxt])
21:39clojurebotjava.lang.IllegalArgumentException: Wrong number of args (2) passed to: PersistentVector
21:43TeXnomancytrptcolin: I think this subtask-help mechanism could be abstracted and shared
21:43trptcolinTeXnomancy: absolutely
21:43TeXnomancyI know autodoc needs a similar thing
21:44trptcolinthere's also other stuff in lein-plugin that was essentially copied from another task (install, i think) that i was planning to simplify once we get merged
21:45trptcolininteresting, i hadn't thought of it being abstracted into its own thing outside of leiningen, but that makes sense
21:49TeXnomancyI'm thinking having subtask support in the help namespace actually
21:49TeXnomancymaybe subtasks could be metadata on a task, and help could check it.
21:50trptcolinah, gotcha. i was just looking at autodoc for the first time - didn't realize it was already depending on leiningen anyway
21:52trptcolinsounds pretty clean to me
21:52TeXnomancydare I say simple? =)
21:53trptcolinoh noez!!! ;)
21:54TeXnomancypushed
21:55NafaiWere there videos taken of the conference?
21:56TeXnomancyNafai: yes, but not professionally.
21:56TeXnomancythe Conjure guy brought recording gear
22:05drewrNafai: no guarantee on when they'd be up
22:05trptcolintechnomancy: cool, just pushed a typo fix. i'll tackle moving the help stuff over, as well as adding some tests for that & plugin stuff. probably not tonight though
22:06NafaiI'm actually wanting to see Rich's keynote
22:06trptcolinso if you want to grab it first that's cool
22:09technomancyhah; nice catch. I was debugging and left that out.
22:09technomancyno rush on the help moving.
22:11trptcolincool.
22:12trptcolinNafai: the keynote was great! 5-word summary: "Think hard. Write it down."
22:12NafaiYeah, sounds inspiring
22:12RaynesDon't forget hammock time.
22:15trptcolin:) yeah +1 to technomancy for the "stop. hammock time" image
22:15technomancyhttp://p.hagelb.org/hammock.jpg
22:15trptcolintechnomancy: how many people did you get asking about the google venn diagram today?
22:15amalloyhaha, that's great
22:16trptcolinand as a follow-up, did you know there was another technomancy before that?
22:17technomancytrptcolin: I saw that on hacker news; the guy behind technomancy.org
22:22jweissanyone got some real-life examples of error-kit use? the example in error-kit.clj is a little too simple. i can't figure out if the caller can specify his own handlers or not, and if so, do they have to be named in the with-handler form, or can they be external?
22:26rata_what's the name of the function that returns [(filter pred coll) (remove pred coll)]?
22:26rata_I'm almost sure there is one
22:29jackdempseylol
22:29jackdempseyhammock time. nice.
22:30trptcolin,(clojure.contrib.seq-utils/separate even? (range 10))
22:30clojurebot[(0 2 4 6 8) (1 3 5 7 9)]
22:32rata_thanks trptcolin
22:32trptcolinsure
22:38technomancyseparate needs to be reimplemented using juxt
22:38technomancyit's a textbook juxt
22:39technomancy(juxt (comp filter pred) (comp remove pred))
22:43trptcolini was juxt looking at that
22:46trptcolinactually, i really was looking at it for another reason - takes 2 traversals. could be just 1 with less elegant code
22:47technomancyreduce!
22:48technomancyit's like juxt, but less indie.
22:49lancepantzgroup-by solves the same problem, i'm not sure how its performance characteristics are relative to juxt though
22:50trptcolinlooks pretty fast to me.
22:50trptcolin,(vals (group-by even? (range 10)))
22:50clojurebot([0 2 4 6 8] [1 3 5 7 9])
22:51trptcolinand it uses transient so you know it's fresh
22:52lancepantzi find myself doing group-by + destructing quite a bit
22:59defnStop. Hammock time.
22:59trptcolinindeed. peace out
22:59defnnight tr
23:01defnhowdy monsieur lancepantz
23:02defntechnomancy: can I quote you on juxt and it being less "indie"
23:02technomancywell, it's reduce that's no longer indie
23:03technomancybut I used to listen to reduce before it was on the major labels.
23:03technomancy(for the record)
23:03defnhahahaha
23:03defnthat's /awesome/
23:03defnbtw, great image -- i had a similiar idea which ill need to sleep on ;)
23:04defnwaking mind is preventing me from commiting to it
23:06rata_good night :)
23:07rata_see you tomorrow
23:11lancepantzhey defn
23:11lancepantzhow was the flight back?
23:11lancepantzhave to ride the bus again?
23:12defnnot too shabby -- only trouble was i crossed my right leg over my left and promptly fell asleep. feels like i have a staph infection in my right leg as a result.
23:12defngoing home was easy compared to the 1:30am bus ride on the way down
23:13lancepantzi bet
23:13defnstill tired from the 3 nights of consecutive "stay up until 3am talking code, go to bed, wake up at 7am and go to talks for 12 hours" routine
23:14defnbut i had a mini breakthrough at work on clojure -- sounds like people are starting to get more and more interested
23:15lancepantzyeah i missed the morning talks the second day
23:15lancepantzhung over from the night before
23:18defni made it and wanted to kill myself most of the afternoon
23:18defnrich's talk owned, though...
23:18lancepantzyeah, i loved it
23:19defnsome people were being sort of snarky about it which sort of pisses me off
23:19lancepantzreally?
23:19lancepantzoh, how was the bbq btw?
23:20defnawesome. i broke a corona on stu's floor and made his foyer smell like beer for what i would imagine is the foreseeable future
23:21defn*facepalm*
23:21defni think i apologized 2-400 times, cleaned it up, vacuumed, begged forgiveness, etc.
23:22lancepantzhehe
23:23defnbut anyway, the {:bbq "fantastic"}
23:23defnchapel hill is beautiful area
23:25defnlancepantz: how was your trip home
23:26lancepantzlong and sleepily
23:26lancepantzi can't sleep on planes
23:27lancepantzfor that matter, i couldn't sleep at the conj either
23:27lancepantzso i slept til 2pm on sunday
23:27lancepantzdidn't get to go surfing, disappointed
23:27lancepantzneeded the sleep though
23:41amalloyooc what was the mean age at the conj? am i talking to surprisingly hip old geezers, or surprisingly mature young'uns?
23:42amalloy(or is it rude to even ask on irc? not exactly an irc veteran myself)
23:43maravillasseemed like a decent mix to me
23:45defnin my view: the people who were young are destined to be the people who were older
23:45amalloyhaha i like that
23:46defni had a guy who was in his 50s ask me my age and then tell me he was using emacs before i was born
23:46defnmy only response was that someday ill be in a similar position
23:46amalloydefn: you'll still be using emacs when he's dead!
23:47defnhe was a nice guy -- we're all the same, hunting for a better solution to our problems
23:47amalloyyeah
23:47defnanyway, age is irrelevant, i talked to people who were 5 years my junior who put my knowledge to shame
23:47amalloywell yeah. i mean, Raynes was there
23:48defn(inc Raynes)
23:49defnspeaking of which, we need to have karma added to sexpbot. it used to be nick++, but should be implmeneted in sexpbot as (inc nick)
23:50defnim gonna go read some lisp in small pieces for awhile
23:50defncheers
23:50amalloyAS IT HAPPENS i'm in the middle of adding bits to sexpbot
23:50defnamalloy: nice.
23:50amalloybut i don't know how karma's supposed to work :P
23:50defnit's simple. (inc nick) gives nick +1
23:50defn{:nick 1}
23:51defn(inc nick) => {:nick 2}
23:51defn(dec nick) => {:nick 1}
23:51defnanyway, gotta get a bit of reading in before bed, ciao