#clojure logs

2011-06-01

00:07scottjis there a predicate for whether something will work with get? I didn't realize (System/getenv) would work with it. What about a predicate for whether seq will work on something?
00:14dnolenscottj: not yet, but you can provide the functionality for yourself via protocols, http://dosync.posterous.com/51626638
00:34scottjdnolen: cool, would be a nice library
01:15seancorfield__if i have a function and a collection, i can do (apply fn coll) to invoke the function with the elements of the collection as arguments...
01:15seancorfield__...but that doesn't work with a macro
01:15seancorfield__if i have a macro and a collection, how can i do the equivalent of apply?
01:16amalloyseancorfield__: you can't, because the collection doesn't have a value when the macro is run - at *compile* time
01:17amalloyi mean, there are workarounds like (eval `(mymacro ~@mycoll))
01:17amalloybut it's not really how macros are supposed to work
01:18seancorfield__yeah, that's what i figured
01:18seancorfield__i'm trying to use enlive to do stuff it clearly wasn't designed to do
01:19seancorfield__enlive is nearly all macros... :(
01:19seancorfield__i wish it were macros wrapping functions so i could use the functions
01:21seancorfield__frankly, enlive is *really* hard to use outside the confines of its core design...
01:21seancorfield__i've had to unroll so many macros to reuse the underlying code...
01:22amalloyyes, i've heard that about enlive
01:22amalloybut i don't use it, so i have no clever hacks for you
01:22seancorfield__gee, thanx :)
01:23seancorfield__when are you moving to LA? :D
01:24seancorfield__btw, we went to production with our clojure code today!
01:25Ownatikseancorfield__ what did you build with clojure?
01:25seancorfield__we have a small ORM built with clojure, as well as environment control (configuration per tier dev/qa/prod) and database logging
01:26seancorfield__but our core business is all about members in our internet dating sites
01:26seancorfield__and all members are handled by clojure now... along with page content, metadata, form metadata and a few other things
01:27Ownatiknice
01:28seancorfield__we have four out of fifty sites live on the new platform... so it's early days... but i''m pleased with how it's going so far
01:29amalloyseancorfield__: tomorrow morning. pretty soon i'll have to shut down the desktop and pack it up too
01:29Ownatikgood news
01:29Ownatikdidn't know you were running dating sites
01:31seancorfield__heh... vietvibe.com, latinromantico.com, lovingbbw.com, deafsinglesmeet.com are all on the new platform
01:31seancorfield__we have a lot more to migrate
01:31seancorfield__and we're very pleased with the code compression we're seeing with clojure
01:31scottjseancorfield__: are you using latest enlive? I thought cgrand's entire conj talk was about making macros in enive be functions
01:32seancorfield__using enlive 1.0.0
01:33seancorfield__that seems to be the latest version?
01:34scottjyeah
01:35amalloyscottj: i thought his talk was about how the macros should have been functions and it's such a mess because they aren't
01:35seancorfield__well, i'd agree with that
01:36seancorfield__it's been an interesting learning experience, given where i am with clojure
01:37scottjamalloy: yeah maybe I'm probably misremembering I thought maybe with each version he made more of the macros be functions
01:37seancorfield__that would be enlive 2.0.0 then :)
01:37Ownatikwhere you are ... ranked 66 on 4clojure :P
01:38amalloyscottj: well, i haven't seen the video, or used enlive. i'm just repeating what i've soaked up and corrupted while listening in #clojure
01:38seancorfield__i haven't touched 4clojure for _weeks_
01:38seancorfield__i'm so behind!
01:38Ownatikhehe
01:38Ownatikdid the 5 first couple minutes ago ... :P
01:40seancorfield__i need to find some time to get back on 4clojure and get back to #1 :)
01:40Ownatikyou were?
01:45amalloynew problem on 4clojure: do all of amalloy's work for the next month. solved: 0 times
01:45seancorfield__pah!
01:46seancorfield__yeah, i was #1 on 4clojure for a while... but work got in the way of doing the fun problems :)
01:46seancorfield__well, i sent christophe an email about enlive
01:48amalloyseancorfield__: "a while"? i think our (totally arbitrary) secondary-sort happens to favor people who solved their last problem most recently
01:49seancorfield__if i can port FW/1 to Clojure, i can do a lot more of my day-to-day work in Clojure :)
01:49seancorfield__amalloy: a while = what? the first weekend it was released? the first 64 questions? :) :)
01:50seancorfield__if i can find a weekend with nothing on where i can focus on 4clojure, i'll crack 'em all, i swear :)
01:54amalloyseancorfield__: perhaps that weekend would be better spent forking 4clojure and adding a secondary sort that *looks* innocuous but happens to favor seancorfield
01:55seancorfield__i would never stoop so low
01:56seancorfield__as my wife says, i'd rather be right than president :)
02:02seancorfield__is there a nice clean shorthand for (if f (f x) y)
02:04scottjon 4clojure how do you see other ppl's solutions after solving a problem?
02:04amalloyscottj: you can't right now
02:04seancorfield__it's weird, with clojure i see stuff and want to mercilessly refactor it all the time
02:04amalloyyou can see the graph of how long their solution is, but it's still up to the user whether they want to share their stuff via twitter
02:04seancorfield__i saw someone tweet something similar to that recently
02:05scottjamalloy: is there a hashtag or keywords to search twitter for solutions to a specific problem?
02:05seancorfield__#4clojure
02:05amalloyscottj: uhhhh, before twitter started mercilessly converting everything to t.co you could search for the url of the problem
02:06amalloyand now that we're putting the title of the problem into the tweet text, you can try searching for that
02:06scottjok that works
02:13Jeffrey04@seancorfield__ you're on 4clojure too?
02:14Jeffrey04do you know how to solve the questions involving graphs/trees?!?
02:14amalloyJeffrey04: they're all well-known problems with sample algorithms on wikipedia
02:14Jeffrey04@amalloy @.O
02:15amalloyeg, my horrible implementation of transitive-closure was: (1) define a transitive-once function to compute two-step availability, (2) iterate transitive-once until the graph stops changing
02:17amalloya much more efficient solution would be to convert the edges into an NxN connectivity matrix, and raise it to the nth power; this is how imperative languages often do it
02:17amalloyanyway, i guess i've run out of ways to put it off; i'm going to pack up my computer for the move. night, folks
02:18Jeffrey04@amalloy night
02:23seancorfield__take care amalloy_ see you on the other side
02:24seancorfield__poor sap, moving to LA :)
02:57Jeffrey04i am trying https://4clojure.com/problem/95 , may I know why [1 [2 [3 [4 false nil] nil] nil] nil] should return false?
03:09Chousukejeffrey: probably because false is a value but it doesn't have any child nodes
03:10Chousukeit should be [false nil nil]
03:14clgvI want to store standard clojure data structures via "pr" and read them via "read-string". the problem is that the data is tree-like and I'll get the leafs one by one and have to store them immediately to free memory. in XML I would simply write the parent opening tags followed by the leafs one by one and the finally add the closing parent tag.
03:14thorwilthe entire difference between filter and keep is testing against false vs nil?
03:16clgvI guess there is no way to do that with pr. I'll have to store the parent-data independently and build the relation via an ID
04:05Jeffrey04Chousuke: thanks... lol
06:14Jeffrey04erm... does anyone know how to solve problem 82 @ #4clojure ?
06:18clgvJeffrey04: the trivial approach: take the first element and check if any of the others has edit distance 1 to it, if not you are already done
06:19clgvif you find only one than you probably have one of the ends
06:19Jeffrey04clgv: i am still thinking whether it is somehow similar to the transitive closure problem
06:20clgvmaybe. you can build a graph between the words whose edges are defined by the edit distance of one
06:22Jeffrey04yea, still thinking :( not really good in this kind of problems
06:22mrBliss`Jeffrey04: for 82 I wrote a function that returns the permutations of a seq. Checking if a permutation results in a continuous word chain is the fun part :-)
06:23Jeffrey04mrBliss`: i like ur solution
06:23Jeffrey04ahahahahahaha
06:23mrBliss`Jeffrey04: why is it so funny?
06:23clgvbut n! times seems no reasonable running time complexity ;)
06:23Jeffrey04mrBliss`: no offense, it just sounds fun
06:24mrBliss`clgv: I know, but n < 10, so it doesn't matter much ;-)
06:24Jeffrey04ok... /me brain not functioning properly
06:24Jeffrey04lol
06:24fliebelS basically jist permutations + levenschetein
06:24clgvthey dont seem to track execution time so it's not worth it, I guess ;)
06:26mrBliss`My non-minimized solution (including comments) for 82 has a code golf score of 472, which is quite good according to the histogram!
06:26clgvah problem 89 was corrected in the meantime
06:26clgvwhere do you get the statistics
06:27mrBliss`clgv: enable them in your account settings
06:27Jeffrey04mrBliss`: lol, I always score super high, which is at the far end according to the histogram
06:27mrBliss`I only needed 34 chars for 98, it's quite trivial
06:28Jeffrey04is golf score = # of characters?
06:29mrBliss`Jeffrey04: correct
06:29Jeffrey04mrBliss`: i used 104 characters for that
06:29Jeffrey04lol
06:29Jeffrey04will probably revisit sometime in future
06:29Jeffrey04lol
06:30clgvI have no account yet ;)
06:30mrBliss`knowing a lot of the functions in clojure.core helps a lot
06:30Jeffrey04eee... my answer for problem 89 is gone
06:30Jeffrey04:/
06:31clgvproblem 89's definition was wrong because they used sets
06:31Jeffrey04iC
06:31clgvsome of the written test cases were wrong because of that
06:32Jeffrey04ooo
06:32Jeffrey04yea, my code failed the unit test
06:32Jeffrey04sigh
06:32clgvI noticed when answering someone
06:32Jeffrey04oh... ouch, each edge needs to be visited exactly once
06:32Jeffrey04:/
06:33clgvyes and there multiple edges per node pair
06:33mrBliss`Somebody used 1500 chars for 89, wow. He probably constructed actual tours of the graph! My course in graph theory has been quite useful for 4clojure and projecteuler ;-)
06:33Jeffrey04yea, gotta check again
06:34Jeffrey04lol
06:34clgvgotta start coding some problem solutions in my spare time.
06:36Jeffrey04hahahaha, my solution doesn't really answer the question
06:36Jeffrey04sigh
06:37Jeffrey04my last solution was submitted like half an hour ago
06:37Jeffrey04lol
06:37Jeffrey04now gotta re-do again
06:37Jeffrey04:D
06:38fliebel(comp set #(map set %) vals group-by) Half of that was because of the sets... :(
06:39clgvfliebel: ?
06:39mrBliss`fliebel: Almost identical to my solution! (I used #( instead of comp though).
06:40fliebel*unresolved tension*
06:41fliebelTo bad you can't run core.logic on 4clojure.
06:42clgvfliebel: you can. but you would have to copy and paste it everytime ;)
06:42fliebelclgv: How do you mean?
06:42mrBliss`clgv: say bye bye to a good code golf score ;-)
06:43fliebelWhere can I see the golf score?
06:43mrBliss`fliebel: enable it in your account settings
06:44fliebelmrBliss`: Okay, and now? Everything still looks the same.
06:45mrBliss`fliebel: resubmit one of your solutions
06:49Jeffrey04eh... now word chain and graph tour looks like the same problem
06:50clgvJeffrey04: not in general
07:21clgvhumm I cant get crane to be build with leiningen. it has strange dependency versions
07:21clgvthis one: https://github.com/getwoven/crane
07:26fliebelDoes anyone know how ratios work in Clojure? ##(/ 42 56) I mean, does it calculate the greatest common divisor somewhere? rationalize only points to a lot of BigDecimal stuff.
07:26sexpbot⟹ 3/4
07:30clgvfliebel: yeah it does
07:31fliebelclgv: You understand how? I only see some random casting and branching and then it does black magic to BigDecimal en the ratio comes roling out.
07:31clgvfliebel: I looked it up a while ago and saw that there are explicit calls to gcd computation
07:33fliebelclgv: Care to point out where? https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L303
07:35clgvfliebel: you can search for gcd in there and will find it in a lot of operations
07:36fliebelah!
07:38fliebel&(clojure.lang.Numbers/gcd (long 4) (long 7))
07:38sexpbotjava.lang.IllegalArgumentException: No matching method: gcd
07:39clgv&(clojure.lang.Numbers/gcd 4 7)
07:39sexpbotjava.lang.IllegalArgumentException: No matching method: gcd
07:40clgvit's in LongOps for example
07:40clgv&(clojure.lang.Numbers.LongOps/gcd (long 4) (long 7))
07:40sexpbotjava.lang.ClassNotFoundException: clojure.lang.Numbers.LongOps
07:40clgvand not public...
07:43fliebelhm, okay. I'm trying to save chars on 4clojure #100 by using ratios. They seem to have the info I need in a hidden place with ahidden relation between them.
07:48fliebel#(let [r (apply / %&)] (* (numerator r) (denominator r))) ; works for the first 2
07:57clgvyay. my calculation returns "NaN" :/
07:58fliebelclgv: Mine returns wrong stuff for ratios :(
08:04clgvlol found it. (log2 0.0)
08:06fliebelme too! #(reduce (fn [n r] (* r (numerator (/ n r)))) %&)
08:07clgvlol you dont want to calculate a gcd yourself? ;)
08:09fliebelclgv: I bet it takes more characters.
08:09clgvfliebel: shouldnt there be something in java's math?
08:09fliebelclgv: I couldn't find it.
08:09clgvit takes also more chars to call it? ;)
08:10clgvhumm you could try to compress your code if there is a built-in decompress ;)
08:11clgvlike: (eval (decompress "ABHOUIAHSSÖAKJPKM")) ;)
09:42gfrlogI recall sometimes "lein repl" would automatically switch into the project's core namespace. It doesn't seem to do that anymore though. Anybody know what it is? (i.e., an old/new feature, or something that requires special config...)
09:58gfrlogI find it strange that when I search clojuredocs for "refer-clojure" there are no results, but when I search for "refer" then I get "refer-clojure" as the first result
10:00fliebelgfrlog: Maybe it's when you specify :main?
10:04brianhere's what i mentioned yesterday
10:04brianhttp://www.engadget.com/2011/05/29/nvidias-quad-core-kal-el-used-to-demo-next-gen-mobile-graphics/
10:04Guest13677err wrong chat sry
10:09Fossidamn. the vid doesnt even show blown brains
10:39clgv$findfn [1 2 3 4 5 6] 2 [2 4 6]
10:41clgvI want a function that returns every second value from a sequence
10:41clgvbut I forgot its name...
10:43wastrel(first (rest s)) ?
10:43clgvlol no
10:43fliebeltake-nth
10:43clgvyeqah take-nth was it
11:09andrewclegghey, anybody here use maven to build mixed clojure/java projects?
11:10andrewcleggI can see the Java bits get compiled first, and they appear in target/classes ok, but then I get ClassNotFoundException when I try to compile Clojure code which refers to them
11:17andrewcleggstuartsierra: was kinda hoping you might have a suggestion for that ^^ ? :-)
11:34stuartsierraandrewclegg: sorry, haven't encountered that problem before
11:35andrewcleggnp, thanks stuartsierra, will keep tinkering
11:35andrewcleggany other maven mavens around?
11:37stuartsierrait should just work
11:37andrewcleggyeah :-)
11:42andrewcleggmay be complicated by the fact that the classes are generated by Thrift plugin in an earlier phase
11:43wastrelif you google recursion it asks if you meant to search for recursion
11:49dpritchett`didn't you?
11:49dpritchett`guess that's a tautology :(
11:57wastrelit's meant to be a joke :]
12:03andrewcleggargh, was a typo all along, my bad
12:19ataggartif anyone with jira admin privileges is on, please create a new tools.logging project.
12:22cemerickataggart: any idea what the key should be?
12:22ataggartTLOG ?
12:23ataggartthere's already TBRENCH for tools.benchmark
12:23ataggarterm test.benchmark
12:23ataggartso maybe not
12:23ataggartyeah TLOG is fine with me
12:24technomancysounds vulcan
12:24cemerickThat seems to fit http://dev.clojure.org/display/design/JIRA+project+key+conventions
12:24cemerickI don't think Rich had stated a preference before I created an NREPL project. :-/
12:26cemerickataggart: http://dev.clojure.org/jira/browse/TLOG
12:26ataggartgreat, thanks
12:26cemericknp
12:27mrBliss`Is it normal that clojure.contrib.lazy-xml requires over 1GB of heap to process a 16MB xml file (iTunes Music Library)?
13:25manutter,(doc reductions)
13:25manutterAck, no bots?
13:25manutter&(doc reductions)
13:25RaynesHrm.
13:25manutter~botsnack
13:25RaynesI'll get him back up.
13:26manuttershhh, I'm trying to lure him out with botsnacks
13:26manutter:)
13:26gfrlogthat is strange that they're both down
13:26gfrlogor maybe they're off together somewhere
13:27Raynesgfrlog: Coincidental, of course.
13:27Raynes$botsnack
13:27sexpbotRaynes: Thanks! Om nom nom!!
13:27manutter:)
13:27manutterthanks
13:27Raynes~botsnack
13:27manutter,(doc reductions)
13:27clojurebot"([f coll] [f init coll]); Returns a lazy seq of the intermediate values of the reduction (as per reduce) of coll by f, starting with init."
13:27clojurebotThanks! Can I have chocolate next time
13:27manutter,(doc reduce)
13:27clojurebot"([f coll] [f val coll]); f should be a function of 2 arguments. If val is not supplied, returns the result of applying f to the first 2 items in coll, then applying f to that result and the 3rd item, etc. If coll contains no items, f must accept no arguments as well, and reduce returns the result of calling f with no arguments. If coll has only 1 item, it is returned and f is not called. If val i...
13:27manutter(reduce + [1 2])
13:27manutteroops
13:28manutter,(reduce + (range 2))
13:28clojurebot1
13:28hiredmanI need multiple clojurebots and master election for failover
13:28manutter,(reductions + (range 2))
13:28clojurebot(0 1)
13:28RaynesStrange that we both rebotted #clojure at the same time.
13:29manutterhmm, so if reduce takes the first 2 terms and applies the function, why isn't "1" the first and only term in (reductions + [0 1])?
13:29manutterIs that a known quirk?
13:30hiredmanreductions may call the function you give it with no args first
13:30gfrlog,(reductions + (range 5))
13:30clojurebot(0 1 3 6 10)
13:31manutterhmm, that seems odd
13:31gfrlog,(let [plus (fn [a b] (+ a b))] (reductions + (range 5)))
13:31clojurebot(0 1 3 6 10)
13:31gfrlogwhops
13:31manutter,(reductions #(vector % %2) [0 1])
13:31clojurebot(0 [0 1])
13:31gfrlog,(let [plus (fn [a b] (+ a b))] (reduction plus (range 5)))
13:31clojurebotjava.lang.Exception: Unable to resolve symbol: reduction in this context
13:31gfrloggarg
13:32manutterthere's another mind thoroughly boggled
13:32gfrlog,(let [plus (fn [a b] (+ a b))] (reductions plus (range 5)))
13:32clojurebot(0 1 3 6 10)
13:32stuartsierra`reductions` returns the init value first. If no init value is supplied, it uses the first element of the sequence.
13:32gfrlogyeah I was about to conclude that
13:33manutterfair enough, but I'm confused as to why it does so
13:33gfrlogit makes sense to me. If you don't need it, call rest I guess
13:33gfrlog(def manutter-reductions (comp rest reductions))
13:33manuttereh
13:33manutterheh
13:34manutterIt doesn't bother me per se, I'm just not seeing the connection between the stated purpose of the function and its actual behavior
13:34gfrlognot that I've ever used reductions before, but it seems like the initial value ought to be part of the sequence
13:34gfrlogwhat were you going to use it for?
13:34manutterI'm not using it per se, I'm doing the 4clojure exercise where you define your own "reductions" func from scratch
13:35manutterMine didn't include the init value as the first term, and I was curious as to why it was supposed to.
13:35gfrlogoh. Well then neither of us are entitled to an opinion I guess :)
13:35manutter:)
13:36gfrloglooks like 5clojure.com is available for all you squatters
13:36manutterlol
13:37chouserreduce on a collection with just one value in it returns that value
13:37hiredmandnolen: does the unifier have some way to match the rest of a sequence, like [foo & bar] ?
13:37chouserso the first item in the seq returned by reductions is always the first item in the input seq
13:37gfrlog,(reduce assoc [10])
13:37clojurebot10
13:37gfrlog(def identity (comp (partial reduce assoc) (vector)))
13:38manutterchouser: Ok, that begins to make sense
13:39manutterso reductions returns [(reduce f [1]) (reduce f [1 2]) (reduce f [1 2 3]) ...], given (reductions f [1 2 3 ... n])
13:40manutterconceptually, anyway
13:40chouseryeah, I think that's right.
13:41manuttercool, I can dig it :)
13:41gfrlog,(reduce assoc [])
13:41clojurebotjava.lang.IllegalArgumentException: Wrong number of args (0) passed to: core$assoc
13:55dnolenhiredman: I had that feature a long time ago but I haven't revisited it. Are you unifying a vector, list?
13:58hiredmandnolen: either, I want to be able to match the equiv of v :: nil
14:03dnolenhiredman: I'll look into it, should be too hard.
14:03dnolens/should/shouldn't
14:03sexpbot<dnolen> hiredman: I'll look into it, shouldn't be too hard.
14:56markomanhow do these differ: (-> 1) and ((fn [x] x) 1)
14:56markomanor even (# 1)
14:57stuartsierra#(1) won't work.
14:58ohpauleez(fn [x] x) is the identity function, the last one is an anonymous function doing the same thing
14:58ohpauleezthe threading form essentially is the same thing, but is a macro
15:01markoman(# 1) returns 1 but gives some extra warnings
15:07Chousukehuh
15:07Chousuke,(# 1)
15:07clojurebotNo dispatch macro for:
15:08hiredman# means "dispatch on the next character"
15:08stuartsierrayes
15:08hiredmanthe next character is
15:08hiredman\space
15:36markomanOk, just wondering these "special forms"
15:38hiredmanmarkoman: you always ask all these involved questions, with the amount of time you put in to it, why don't you just read the source?
15:39markomanconversation and interaction may give more
15:39hiredmanlike, if you've written a lisp (takes a few hours to a few days depending) the anwsers are all right there
15:39S11001001I wonder if you could put an arrow into an arrow, or vice versa.
15:40hiredmanwhy not? the arrow is just a transform of a datastructure, and an arrow is a datastructure
15:41markomani think clojure is much different than common lisp, icarus or scheme I slightly studied before
15:45scottjwhat's the rational for having tests that use "are" and give too few args not raise errors?
15:45hiredmanright, but the design space, the roadsystem is the same, just different turns
15:45tufflaxI want to serialize clojure data structures to byte arrays. Should I use java's ByteArrayOutputStream or is there a more convenient way in clojure?
15:45hiredmanscottj: no one uses are?
15:45scottj(deftest test-+ [] (are [a b] (+ a b) 1)) <-- won't fail or give error
15:46scottjoh wait, this might be me not using =, one sec :)
15:47scottjnope I think it's real, (deftest test-+ [] (are [a b c] (= (+ a b) c) 1 2))
15:48hiredmanI went to use (are ...) in a test at work once, then someone said "why, all the other tests use is" so all our tests use is
15:48stuartsierraThe point of `are` was to make it easy to repeat the same test with different inputs. The implementation isn't all that great.
15:49scottjstuartsierra: is the problem I'm talking about clear/known?
15:50stuartsierraI don't think it's common enough to be a problem.
15:51scottjwhere someone forgets a parameter?
15:51hiredmanlike I said, not one uses 'are', so no one has ever run into the corner cases
15:52raektufflax: I think that would be the most obvious way of doing it, yes (let [baos (ByteArrayOutputStream.)] (binding [*out* (io/writer baos)] (pr some-data-structure)))
15:52stuartsierra`are` was only for cases where you have multiple sets of parameters. If you leave one out, your test should fail.
15:53scottjstuartsierra: yeah, the point is it doesn't fail.
15:53raektufflax: here the byte array will contain the UTF-8 encoded string representation of the data structure, which may or may not be what you were looking for
15:54tufflaxraek ok, thank you... again :)
15:55scottjstuartsierra: (deftest test-+ [] (are [a b c] (= (+ a b) c) 1 2 3 2 2)) ; note missing 4 at end {:type :summary, :pass 1, :test 1, :error 0, :fail 0}
15:56stuartsierrayes I see
15:57stuartsierrathat's worth catching
15:57stuartsierraPlease make a JIRA ticket.
15:58symboleWhat are some options right now when it comes to Clojure and comet? Is it to wrap exiting Java solutions?
15:58raektufflax: oh, you probably need a (flush) call after that (pr ...) call, otherwise the data might not show up... :-)
16:08dnolensymbole: see Aleph
16:15symbolednolen: Thanks.
16:22dpritchett`does Chris Granger (ibdknox) frequent #clojure?
16:23redinger$seen ibdknox
16:23sexpbotI have never seen ibdknox.
16:24dpritchett`I liked the look of https://github.com/ibdknox/noir and wanted to say hi
16:24redingerIf so, not with that nick I'd say
16:29hiredmanclojurebot: ping
16:29clojurebotPONG!
16:39hiredmandnolen: so it was pretty simple to modify it to turn '(cons ?foo ?bar) into (lcons … …) using replace-lvar, so [(cons ?a ?b)] unifies with [(1 2)] but (cons ?a ?b) doesn't unify with (1 2) because lcons can't carry metadata
16:40hiredmansimilarly ?a will throw exceptions instead of unifying with anything because lvars can't carry metadata
16:43tufflax(alength (to-byte-array '(1 2 3 4 "arstarst"))) => 779, (alength (to-byte-array (str '(1 2 3 4 "arstarst")))) => 27. Hehe. Hmm, I'm trying to make a multiplayer game, and I thougth representing messages as clojure data structures was a good idea. Maybe it still is. Any tips or comments?
17:00lnostdalhm, slime-insert-balanced-comments .. i miss #| multi-line comments |# :)
17:00lnostdal..out, test, back in ... out something else .. test, back in .. etc. etc. etc. etc.
17:03raekamalloy: I'm trying to use Piped{Input,Output}Stream... did you find anything with them that was strange?
17:11dnolenhiredman: interesting ... I'm not against opening up LVar and LCons to metadata to allow for such experiments
17:12hiredmanactually
17:12hiredmanmatch.core> (binding-map '?a [1 [2 4] 3])
17:12hiredman{}
17:12hiredmannot sure what the deal is with that
17:12dnolenhiredman: probably some bad assumptions, I don't use binding-map or unifier myself, feel free to open tickets in JIRA.
17:13hiredman*sigh* sure, if I have time this evening
17:45BorkdudeI have a clojure project that I didn't use for some time, it got started with a script in folder script/run.clj
17:46Borkdudebut apparently lein run script/run.clj doesn't work anymore
17:46Borkdudewhat's the best way to fix?
17:46bdeshamBorkdude: it's an old leiningen project?
17:47Borkdudebdesham: what is old?
17:48bdeshamuh... incompatible, I guess :)
17:48Borkdudeit worked until recently
17:48BorkdudeI don't know what happened to it actually
17:48technomancythe built-in "lein run" is for namespaces on the classpath
17:49technomancyprobably you were using the plugin before
17:49raekBorkdude: lein run is now a part of leiningen (and behaves a bit differently), but you the old plugin should be used if you have it as a dev-dependency in your project
17:49Borkdudetechnomancy: ah, that's it I guess, let me check
17:50raekBorkdude: if you before had (ns foo.bar) (start) and started it with "lein run src/foo/bar.clj", you would now do (ns foo) (defn -main [] (start)) and start with "lein run -m foo.bar"
17:51raek(or add :main foo.bar to the project.clj and skip the -m foo.bar part)
17:53Borkdudetechnomancy: if I put the plugin back into the dev-dependencies should "lein run <file>" work?
17:56technomancyit should
18:02technomancybut it would be best to move the code to a -main function on the classpath
18:06Borkdudeok, well the old behavior isn't working anymore with the lein-run plugin, but I'll move it to a -main, tnx
18:07technomancythere was briefly a version of 1.4.x that had built-in tasks shadow plugins, but it was fixed pretty quickly.
18:08BorkdudeI'm using 1.5.2
18:24kencauseyI'm trying to get technomancy's new easy clojure-mode to work on cygwin on xp but lein seems to use USERPROFILE when it should be using HOME
18:25kencauseyspecifically lein plugin install is putting the files in the wrong place
18:25technomancykencausey: ah, I had some bug reports on that earlier but they didn't include enough detail
18:25technomancyso is (System/getProperty "user.home") wrong?
18:25kencauseyOK, I would be happy to help provide info, a moment...
18:26kencauseyI've got to figure out how to start clojure first ;)
18:26offby1that's the hard part, in my experience
18:27technomancyjava -cp ~/.lein/self-installs/TAB clojure.main
18:28kencauseyall that's in self-installs is leiningen-1.5.2-standalone.jar
18:28technomancythat'll do
18:28kencauseyoh right
18:28kencauseyjava.lang.NoClassDefFoundError: clojure/main
18:29kencauseyI need a CLASSPATH or something?
18:30kencauseyabsolutely
18:30technomancyno, -cp should do it. suspect that jar is not what it claims to be
18:30kencauseyperhaps the issue is a cygwin/dos thing?
18:31technomancyquick workaround fix would be to symlink $USERPROFILE/.lein to $HOME/.lein I guess
18:32kencauseytrying that
18:33__name__or to use a proper os
18:34kencauseyI normally do, but development of projects from multiple systems requires using less preferred systems sometimes
18:35kencauseytechnomancy: oh your blog mentioned 1.4.0 in the video but 1.3.1 in the text, does it matter which is used?
18:35technomancykencausey: either will do
18:35technomancy1.3.1 is preferred if you want a stable version, while 1.4.0-SNAPSHOT has new debugger features
18:35kencauseyI'm willing to bleed a bit to start with anyway
18:39BorkdudeI'm trying out the clojure app on heroku thing
18:39kencauseyI think java doesn't like my symlink
18:39BorkdudeI wonder where I can find documentation about the cedar stack and support of clojure
18:39kencauseyInstalling shell wrapper to C:\Documents and Settings\Ken\.lein\bin\swank-clojure
18:39kencauseyException in thread "main" java.io.FileNotFoundException: C:\Documents and Settings\Ken\.lein\bin\swank-clojure (The system cannot find the path specified) (NO_SOURCE_FILE:0)
18:40Borkdudeand also: someone maybe has a clue why this goes wrong? https://gist.github.com/1003529
18:49technomancyBorkdude: maybe a timeout? there could be a limit on how long processes may take to launch?
18:54seancorfieldoddness... i had a (ns) decl where i accidentally missed the : off the require keyword... but it still seemed to work...? known undocumented behavior?
18:58ataggartcould you reference vars in the other ns?
19:02Borkdudetechnomancy: could be...
21:44hiredmandnolen: cond-m used to create a pattern matchy fn equiv used to implement a secd machine https://gist.github.com/1003761
21:46dnolenhiredman: wow cool! :)
21:48hiredmanI have been hacking on various incarnations of a clojure compiler in clojure and lately have been leaning towards something like a secd for code generation and the nicest descriptions are all written with pattern matching
21:53dnolenhiredman: I think the pattern matching stuff I'm working on will be better suited for this kind of thing, but until then core.logic unification will have to do.
21:53hiredmanit's all I've got
21:53danlarkinTHAT'S NOT TRUE HIREDMAN
21:54danlarkinYOU HAVE ME
21:54hiredmanI certainly don't want to implement pattern matching, I just want to use it
21:54hiredmandanlarkin: thanks dude
21:54hiredmanthere are a number of other implementations for clojure, but they all seem to be disgusting
21:55hiredmanone of them uses eval to generate fns so it destroys the ability to recur
21:55hiredmanugh
21:57chouseris there any way to get clojure maven plugin to include the test files in the classpath for clojure:repl ?
21:58dnolenhiredman: I plan on implementing plain pattern matching first, predicate dispatch will come later. Yeah I don't like the syntax of what's out there. I want to stick very closely to Clojure idioms.
21:58danlarkinchouser: I'm going to BM and say why the heck are you using the clojure maven plugin
22:00chouserI'm working on clojure.data.xml
22:00hiredmanlein needs a way to ingest a pom.xml and spit out a project.clj
22:00danlarkinah, so because SS likes maven
22:01danlarkinsorry, I know that's not helpful. No I don't know how :-/
22:04chousermerely out of curiosity, do you know the answer to the equivalent lein question?
22:05hiredmanI believe tests are on the classpath for lein repl and lein swank
22:05danlarkinI think they're on the classpath for lein repl already
22:06hiredmanthey definitly are for lein swank, but I never use lein repl
22:30chouserbleh. I don't see how it's possible
22:32chouserah. symlink. well, that'll do. *sigh*
22:35chouserslander!
22:35chouserclojure:repl does include tests by default, no symlink needed.
22:35chouserI had a typo. :-P
22:41hiredmanI'd like to blame clojure maven plugin for your typo, so I will
23:17technomancydanlarkin: BM?
23:18hiredmanbusiness machines?
23:18danlarkinbad manner, a common term used to describe poor sportsmanship in electronic sports, often abbreviated to "bm"
23:19technomancyso not bowel movement then. that's good.
23:19technomancygithub needs to support the <blink> tag
23:21technomancyis there a reasonable use case for setting user-level mvn repositories?
23:21technomancyseems like it's just a recipe for http://www.codeodor.com/images/works-on-my-machine-starburst.png
23:24technomancyhrm; I'll just stash this until someone talks me into it
23:51kornysHi - anyone played with Heroku's clojure support? I'm trying to work out if it's free for small apps, like it is for ruby apps
23:52kornysI seem to have been allocated a single worker, which is costing me 5c an hour...
23:53kornyspretty cheap for a simple demo, but not something I'd like to leave up for a long time.
23:56kornys&(* 0.05 24 30)
23:56sexpbot⟹ 36.00000000000001