#clojure log - Jun 01 2011

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:07 scottj: is 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?

0:14 dnolen: scottj: not yet, but you can provide the functionality for yourself via protocols, http://dosync.posterous.com/51626638

0:34 scottj: dnolen: cool, would be a nice library

0:37 * dnolen has got the very, very basics of Maranget's pattern matching ideas working ... boring ASCII evidence from REPL https://gist.github.com/1001795, now sleep ...

1:15 seancorfield__: 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...

1:15 ...but that doesn't work with a macro

1:15 if i have a macro and a collection, how can i do the equivalent of apply?

1:16 amalloy: seancorfield__: you can't, because the collection doesn't have a value when the macro is run - at *compile* time

1:17 i mean, there are workarounds like (eval `(mymacro ~@mycoll))

1:17 but it's not really how macros are supposed to work

1:18 seancorfield__: yeah, that's what i figured

1:18 i'm trying to use enlive to do stuff it clearly wasn't designed to do

1:19 enlive is nearly all macros... :(

1:19 i wish it were macros wrapping functions so i could use the functions

1:21 frankly, enlive is *really* hard to use outside the confines of its core design...

1:21 i've had to unroll so many macros to reuse the underlying code...

1:22 amalloy: yes, i've heard that about enlive

1:22 but i don't use it, so i have no clever hacks for you

1:22 seancorfield__: gee, thanx :)

1:23 when are you moving to LA? :D

1:24 btw, we went to production with our clojure code today!

1:25 Ownatik: seancorfield__ what did you build with clojure?

1:25 seancorfield__: we have a small ORM built with clojure, as well as environment control (configuration per tier dev/qa/prod) and database logging

1:26 but our core business is all about members in our internet dating sites

1:26 and all members are handled by clojure now... along with page content, metadata, form metadata and a few other things

1:27 Ownatik: nice

1:28 seancorfield__: 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

1:29 amalloy: seancorfield__: tomorrow morning. pretty soon i'll have to shut down the desktop and pack it up too

1:29 Ownatik: good news

1:29 didn't know you were running dating sites

1:31 seancorfield__: heh... vietvibe.com, latinromantico.com, lovingbbw.com, deafsinglesmeet.com are all on the new platform

1:31 we have a lot more to migrate

1:31 and we're very pleased with the code compression we're seeing with clojure

1:31 scottj: seancorfield__: are you using latest enlive? I thought cgrand's entire conj talk was about making macros in enive be functions

1:32 seancorfield__: using enlive 1.0.0

1:33 that seems to be the latest version?

1:34 scottj: yeah

1:35 amalloy: scottj: i thought his talk was about how the macros should have been functions and it's such a mess because they aren't

1:35 seancorfield__: well, i'd agree with that

1:36 it's been an interesting learning experience, given where i am with clojure

1:37 scottj: amalloy: yeah maybe I'm probably misremembering I thought maybe with each version he made more of the macros be functions

1:37 seancorfield__: that would be enlive 2.0.0 then :)

1:37 Ownatik: where you are ... ranked 66 on 4clojure :P

1:38 amalloy: scottj: 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

1:38 seancorfield__: i haven't touched 4clojure for _weeks_

1:38 i'm so behind!

1:38 Ownatik: hehe

1:38 did the 5 first couple minutes ago ... :P

1:40 seancorfield__: i need to find some time to get back on 4clojure and get back to #1 :)

1:40 Ownatik: you were?

1:45 amalloy: new problem on 4clojure: do all of amalloy's work for the next month. solved: 0 times

1:45 seancorfield__: pah!

1:46 yeah, i was #1 on 4clojure for a while... but work got in the way of doing the fun problems :)

1:46 well, i sent christophe an email about enlive

1:48 amalloy: seancorfield__: "a while"? i think our (totally arbitrary) secondary-sort happens to favor people who solved their last problem most recently

1:49 seancorfield__: if i can port FW/1 to Clojure, i can do a lot more of my day-to-day work in Clojure :)

1:49 amalloy: a while = what? the first weekend it was released? the first 64 questions? :) :)

1:50 if i can find a weekend with nothing on where i can focus on 4clojure, i'll crack 'em all, i swear :)

1:54 amalloy: seancorfield__: perhaps that weekend would be better spent forking 4clojure and adding a secondary sort that *looks* innocuous but happens to favor seancorfield

1:55 seancorfield__: i would never stoop so low

1:56 as my wife says, i'd rather be right than president :)

2:02 is there a nice clean shorthand for (if f (f x) y)

2:04 scottj: on 4clojure how do you see other ppl's solutions after solving a problem?

2:04 amalloy: scottj: you can't right now

2:04 seancorfield__: it's weird, with clojure i see stuff and want to mercilessly refactor it all the time

2:04 amalloy: you 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

2:04 seancorfield__: i saw someone tweet something similar to that recently

2:05 scottj: amalloy: is there a hashtag or keywords to search twitter for solutions to a specific problem?

2:05 seancorfield__: #4clojure

2:05 amalloy: scottj: uhhhh, before twitter started mercilessly converting everything to t.co you could search for the url of the problem

2:06 and now that we're putting the title of the problem into the tweet text, you can try searching for that

2:06 scottj: ok that works

2:13 Jeffrey04: @seancorfield__ you're on 4clojure too?

2:14 do you know how to solve the questions involving graphs/trees?!?

2:14 amalloy: Jeffrey04: they're all well-known problems with sample algorithms on wikipedia

2:14 Jeffrey04: @amalloy @.O

2:15 amalloy: eg, 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

2:17 a 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

2:17 anyway, 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

2:18 Jeffrey04: @amalloy night

2:23 seancorfield__: take care amalloy_ see you on the other side

2:24 poor sap, moving to LA :)

2:57 Jeffrey04: i am trying https://4clojure.com/problem/95 , may I know why [1 [2 [3 [4 false nil] nil] nil] nil] should return false?

3:09 Chousuke: jeffrey: probably because false is a value but it doesn't have any child nodes

3:10 it should be [false nil nil]

3:14 clgv: I 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.

3:14 thorwil: the entire difference between filter and keep is testing against false vs nil?

3:16 clgv: I 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

4:05 Jeffrey04: Chousuke: thanks... lol

6:14 erm... does anyone know how to solve problem 82 @ #4clojure ?

6:18 clgv: Jeffrey04: 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

6:19 if you find only one than you probably have one of the ends

6:19 Jeffrey04: clgv: i am still thinking whether it is somehow similar to the transitive closure problem

6:20 clgv: maybe. you can build a graph between the words whose edges are defined by the edit distance of one

6:22 Jeffrey04: yea, still thinking :( not really good in this kind of problems

6:22 mrBliss`: 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 :-)

6:23 Jeffrey04: mrBliss`: i like ur solution

6:23 ahahahahahaha

6:23 mrBliss`: Jeffrey04: why is it so funny?

6:23 clgv: but n! times seems no reasonable running time complexity ;)

6:23 Jeffrey04: mrBliss`: no offense, it just sounds fun

6:24 mrBliss`: clgv: I know, but n < 10, so it doesn't matter much ;-)

6:24 Jeffrey04: ok... /me brain not functioning properly

6:24 lol

6:24 fliebel: S basically jist permutations + levenschetein

6:24 clgv: they dont seem to track execution time so it's not worth it, I guess ;)

6:26 mrBliss`: My non-minimized solution (including comments) for 82 has a code golf score of 472, which is quite good according to the histogram!

6:26 clgv: ah problem 89 was corrected in the meantime

6:26 where do you get the statistics

6:27 mrBliss`: clgv: enable them in your account settings

6:27 Jeffrey04: mrBliss`: lol, I always score super high, which is at the far end according to the histogram

6:27 mrBliss`: I only needed 34 chars for 98, it's quite trivial

6:28 Jeffrey04: is golf score = # of characters?

6:29 mrBliss`: Jeffrey04: correct

6:29 Jeffrey04: mrBliss`: i used 104 characters for that

6:29 lol

6:29 will probably revisit sometime in future

6:29 lol

6:30 clgv: I have no account yet ;)

6:30 mrBliss`: knowing a lot of the functions in clojure.core helps a lot

6:30 Jeffrey04: eee... my answer for problem 89 is gone

6:30 :/

6:31 clgv: problem 89's definition was wrong because they used sets

6:31 Jeffrey04: iC

6:31 clgv: some of the written test cases were wrong because of that

6:32 Jeffrey04: ooo

6:32 yea, my code failed the unit test

6:32 sigh

6:32 clgv: I noticed when answering someone

6:32 Jeffrey04: oh... ouch, each edge needs to be visited exactly once

6:32 :/

6:33 clgv: yes and there multiple edges per node pair

6:33 mrBliss`: 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 ;-)

6:33 Jeffrey04: yea, gotta check again

6:34 lol

6:34 clgv: gotta start coding some problem solutions in my spare time.

6:36 Jeffrey04: hahahaha, my solution doesn't really answer the question

6:36 sigh

6:37 my last solution was submitted like half an hour ago

6:37 lol

6:37 now gotta re-do again

6:37 :D

6:38 fliebel: (comp set #(map set %) vals group-by) Half of that was because of the sets... :(

6:39 clgv: fliebel: ?

6:39 mrBliss`: fliebel: Almost identical to my solution! (I used #( instead of comp though).

6:40 fliebel: *unresolved tension*

6:41 To bad you can't run core.logic on 4clojure.

6:42 clgv: fliebel: you can. but you would have to copy and paste it everytime ;)

6:42 fliebel: clgv: How do you mean?

6:42 mrBliss`: clgv: say bye bye to a good code golf score ;-)

6:43 fliebel: Where can I see the golf score?

6:43 mrBliss`: fliebel: enable it in your account settings

6:44 fliebel: mrBliss`: Okay, and now? Everything still looks the same.

6:45 mrBliss`: fliebel: resubmit one of your solutions

6:49 Jeffrey04: eh... now word chain and graph tour looks like the same problem

6:50 clgv: Jeffrey04: not in general

7:21 humm I cant get crane to be build with leiningen. it has strange dependency versions

7:21 this one: https://github.com/getwoven/crane

7:26 fliebel: Does 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.

7:26 sexpbot: ⟹ 3/4

7:30 clgv: fliebel: yeah it does

7:31 fliebel: clgv: 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.

7:31 clgv: fliebel: I looked it up a while ago and saw that there are explicit calls to gcd computation

7:33 fliebel: clgv: Care to point out where? https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L303

7:35 clgv: fliebel: you can search for gcd in there and will find it in a lot of operations

7:36 fliebel: ah!

7:38 &(clojure.lang.Numbers/gcd (long 4) (long 7))

7:38 sexpbot: java.lang.IllegalArgumentException: No matching method: gcd

7:39 clgv: &(clojure.lang.Numbers/gcd 4 7)

7:39 sexpbot: java.lang.IllegalArgumentException: No matching method: gcd

7:40 clgv: it's in LongOps for example

7:40 &(clojure.lang.Numbers.LongOps/gcd (long 4) (long 7))

7:40 sexpbot: java.lang.ClassNotFoundException: clojure.lang.Numbers.LongOps

7:40 clgv: and not public...

7:43 fliebel: hm, 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.

7:48 #(let [r (apply / %&)] (* (numerator r) (denominator r))) ; works for the first 2

7:57 clgv: yay. my calculation returns "NaN" :/

7:58 fliebel: clgv: Mine returns wrong stuff for ratios :(

8:04 clgv: lol found it. (log2 0.0)

8:06 fliebel: me too! #(reduce (fn [n r] (* r (numerator (/ n r)))) %&)

8:07 clgv: lol you dont want to calculate a gcd yourself? ;)

8:09 fliebel: clgv: I bet it takes more characters.

8:09 clgv: fliebel: shouldnt there be something in java's math?

8:09 fliebel: clgv: I couldn't find it.

8:09 clgv: it takes also more chars to call it? ;)

8:10 humm you could try to compress your code if there is a built-in decompress ;)

8:11 like: (eval (decompress "ABHOUIAHSSÖAKJPKM")) ;)

9:42 gfrlog: I 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...)

9:58 I 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:00 fliebel: gfrlog: Maybe it's when you specify :main?

10:04 brian: here's what i mentioned yesterday

10:04 http://www.engadget.com/2011/05/29/nvidias-quad-core-kal-el-used-to-demo-next-gen-mobile-graphics/

10:04 Guest13677: err wrong chat sry

10:09 Fossi: damn. the vid doesnt even show blown brains

10:39 clgv: $findfn [1 2 3 4 5 6] 2 [2 4 6]

10:41 I want a function that returns every second value from a sequence

10:41 but I forgot its name...

10:43 wastrel: (first (rest s)) ?

10:43 clgv: lol no

10:43 fliebel: take-nth

10:43 clgv: yeqah take-nth was it

11:09 andrewclegg: hey, anybody here use maven to build mixed clojure/java projects?

11:10 I 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:17 stuartsierra: was kinda hoping you might have a suggestion for that ^^ ? :-)

11:34 stuartsierra: andrewclegg: sorry, haven't encountered that problem before

11:35 andrewclegg: np, thanks stuartsierra, will keep tinkering

11:35 any other maven mavens around?

11:37 stuartsierra: it should just work

11:37 andrewclegg: yeah :-)

11:42 may be complicated by the fact that the classes are generated by Thrift plugin in an earlier phase

11:43 wastrel: if you google recursion it asks if you meant to search for recursion

11:49 dpritchett`: didn't you?

11:49 guess that's a tautology :(

11:57 wastrel: it's meant to be a joke :]

12:03 andrewclegg: argh, was a typo all along, my bad

12:19 ataggart: if anyone with jira admin privileges is on, please create a new tools.logging project.

12:22 cemerick: ataggart: any idea what the key should be?

12:22 ataggart: TLOG ?

12:23 there's already TBRENCH for tools.benchmark

12:23 erm test.benchmark

12:23 so maybe not

12:23 yeah TLOG is fine with me

12:24 technomancy: sounds vulcan

12:24 cemerick: That seems to fit http://dev.clojure.org/display/design/JIRA+project+key+conventions

12:24 I don't think Rich had stated a preference before I created an NREPL project. :-/

12:26 ataggart: http://dev.clojure.org/jira/browse/TLOG

12:26 ataggart: great, thanks

12:26 cemerick: np

12:27 mrBliss`: Is it normal that clojure.contrib.lazy-xml requires over 1GB of heap to process a 16MB xml file (iTunes Music Library)?

12:52 * thorwil calls his blog project tlog

13:25 manutter: ,(doc reductions)

13:25 Ack, no bots?

13:25 &(doc reductions)

13:25 Raynes: Hrm.

13:25 manutter: ~botsnack

13:25 Raynes: I'll get him back up.

13:26 manutter: shhh, I'm trying to lure him out with botsnacks

13:26 :)

13:26 gfrlog: that is strange that they're both down

13:26 or maybe they're off together somewhere

13:27 Raynes: gfrlog: Coincidental, of course.

13:27 $botsnack

13:27 sexpbot: Raynes: Thanks! Om nom nom!!

13:27 manutter: :)

13:27 thanks

13:27 Raynes: ~botsnack

13:27 manutter: ,(doc reductions)

13:27 clojurebot: "([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:27 Thanks! Can I have chocolate next time

13:27 manutter: ,(doc reduce)

13:27 clojurebot: "([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:27 manutter: (reduce + [1 2])

13:27 oops

13:28 ,(reduce + (range 2))

13:28 clojurebot: 1

13:28 hiredman: I need multiple clojurebots and master election for failover

13:28 manutter: ,(reductions + (range 2))

13:28 clojurebot: (0 1)

13:28 Raynes: Strange that we both rebotted #clojure at the same time.

13:29 manutter: hmm, 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:29 Is that a known quirk?

13:30 hiredman: reductions may call the function you give it with no args first

13:30 gfrlog: ,(reductions + (range 5))

13:30 clojurebot: (0 1 3 6 10)

13:31 manutter: hmm, that seems odd

13:31 gfrlog: ,(let [plus (fn [a b] (+ a b))] (reductions + (range 5)))

13:31 clojurebot: (0 1 3 6 10)

13:31 gfrlog: whops

13:31 manutter: ,(reductions #(vector % %2) [0 1])

13:31 clojurebot: (0 [0 1])

13:31 gfrlog: ,(let [plus (fn [a b] (+ a b))] (reduction plus (range 5)))

13:31 clojurebot: java.lang.Exception: Unable to resolve symbol: reduction in this context

13:31 gfrlog: garg

13:32 manutter: there's another mind thoroughly boggled

13:32 gfrlog: ,(let [plus (fn [a b] (+ a b))] (reductions plus (range 5)))

13:32 clojurebot: (0 1 3 6 10)

13:32 stuartsierra: `reductions` returns the init value first. If no init value is supplied, it uses the first element of the sequence.

13:32 gfrlog: yeah I was about to conclude that

13:33 manutter: fair enough, but I'm confused as to why it does so

13:33 gfrlog: it makes sense to me. If you don't need it, call rest I guess

13:33 (def manutter-reductions (comp rest reductions))

13:33 manutter: eh

13:33 heh

13:34 It 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:34 gfrlog: not that I've ever used reductions before, but it seems like the initial value ought to be part of the sequence

13:34 what were you going to use it for?

13:34 manutter: I'm not using it per se, I'm doing the 4clojure exercise where you define your own "reductions" func from scratch

13:35 Mine didn't include the init value as the first term, and I was curious as to why it was supposed to.

13:35 gfrlog: oh. Well then neither of us are entitled to an opinion I guess :)

13:35 manutter: :)

13:36 gfrlog: looks like 5clojure.com is available for all you squatters

13:36 manutter: lol

13:37 chouser: reduce on a collection with just one value in it returns that value

13:37 hiredman: dnolen: does the unifier have some way to match the rest of a sequence, like [foo & bar] ?

13:37 chouser: so the first item in the seq returned by reductions is always the first item in the input seq

13:37 gfrlog: ,(reduce assoc [10])

13:37 clojurebot: 10

13:37 gfrlog: (def identity (comp (partial reduce assoc) (vector)))

13:38 manutter: chouser: Ok, that begins to make sense

13:39 so reductions returns [(reduce f [1]) (reduce f [1 2]) (reduce f [1 2 3]) ...], given (reductions f [1 2 3 ... n])

13:40 conceptually, anyway

13:40 chouser: yeah, I think that's right.

13:41 manutter: cool, I can dig it :)

13:41 gfrlog: ,(reduce assoc [])

13:41 clojurebot: java.lang.IllegalArgumentException: Wrong number of args (0) passed to: core$assoc

13:55 dnolen: hiredman: I had that feature a long time ago but I haven't revisited it. Are you unifying a vector, list?

13:58 hiredman: dnolen: either, I want to be able to match the equiv of v :: nil

14:03 dnolen: hiredman: I'll look into it, should be too hard.

14:03 s/should/shouldn't

14:03 sexpbot: <dnolen> hiredman: I'll look into it, shouldn't be too hard.

14:56 markoman: how do these differ: (-> 1) and ((fn [x] x) 1)

14:56 or even (# 1)

14:57 stuartsierra: #(1) won't work.

14:58 ohpauleez: (fn [x] x) is the identity function, the last one is an anonymous function doing the same thing

14:58 the threading form essentially is the same thing, but is a macro

15:01 markoman: (# 1) returns 1 but gives some extra warnings

15:07 Chousuke: huh

15:07 ,(# 1)

15:07 clojurebot: No dispatch macro for:

15:08 hiredman: # means "dispatch on the next character"

15:08 stuartsierra: yes

15:08 hiredman: the next character is

15:08 \space

15:36 markoman: Ok, just wondering these "special forms"

15:38 hiredman: markoman: 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:39 markoman: conversation and interaction may give more

15:39 hiredman: like, if you've written a lisp (takes a few hours to a few days depending) the anwsers are all right there

15:39 S11001001: I wonder if you could put an arrow into an arrow, or vice versa.

15:40 hiredman: why not? the arrow is just a transform of a datastructure, and an arrow is a datastructure

15:41 markoman: i think clojure is much different than common lisp, icarus or scheme I slightly studied before

15:45 scottj: what's the rational for having tests that use "are" and give too few args not raise errors?

15:45 hiredman: right, but the design space, the roadsystem is the same, just different turns

15:45 tufflax: I 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:45 hiredman: scottj: no one uses are?

15:45 scottj: (deftest test-+ [] (are [a b] (+ a b) 1)) <-- won't fail or give error

15:46 oh wait, this might be me not using =, one sec :)

15:47 nope I think it's real, (deftest test-+ [] (are [a b c] (= (+ a b) c) 1 2))

15:48 hiredman: I 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:48 stuartsierra: The point of `are` was to make it easy to repeat the same test with different inputs. The implementation isn't all that great.

15:49 scottj: stuartsierra: is the problem I'm talking about clear/known?

15:50 stuartsierra: I don't think it's common enough to be a problem.

15:51 scottj: where someone forgets a parameter?

15:51 hiredman: like I said, not one uses 'are', so no one has ever run into the corner cases

15:52 raek: tufflax: 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:52 stuartsierra: `are` was only for cases where you have multiple sets of parameters. If you leave one out, your test should fail.

15:53 scottj: stuartsierra: yeah, the point is it doesn't fail.

15:53 raek: tufflax: 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:54 tufflax: raek ok, thank you... again :)

15:55 scottj: stuartsierra: (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:56 stuartsierra: yes I see

15:57 that's worth catching

15:57 Please make a JIRA ticket.

15:58 symbole: What are some options right now when it comes to Clojure and comet? Is it to wrap exiting Java solutions?

15:58 raek: tufflax: oh, you probably need a (flush) call after that (pr ...) call, otherwise the data might not show up... :-)

15:59 * raek tells himself to always test the code before posting it

16:08 dnolen: symbole: see Aleph

16:15 symbole: dnolen: Thanks.

16:22 dpritchett`: does Chris Granger (ibdknox) frequent #clojure?

16:23 redinger: $seen ibdknox

16:23 sexpbot: I have never seen ibdknox.

16:24 dpritchett`: I liked the look of https://github.com/ibdknox/noir and wanted to say hi

16:24 redinger: If so, not with that nick I'd say

16:29 hiredman: clojurebot: ping

16:29 clojurebot: PONG!

16:39 hiredman: dnolen: 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:40 similarly ?a will throw exceptions instead of unifying with anything because lvars can't carry metadata

16:43 tufflax: (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:00 lnostdal: hm, slime-insert-balanced-comments .. i miss #| multi-line comments |# :)

17:00 ..out, test, back in ... out something else .. test, back in .. etc. etc. etc. etc.

17:03 raek: amalloy: I'm trying to use Piped{Input,Output}Stream... did you find anything with them that was strange?

17:11 dnolen: hiredman: interesting ... I'm not against opening up LVar and LCons to metadata to allow for such experiments

17:12 hiredman: actually

17:12 match.core> (binding-map '?a [1 [2 4] 3])

17:12 {}

17:12 not sure what the deal is with that

17:12 dnolen: hiredman: probably some bad assumptions, I don't use binding-map or unifier myself, feel free to open tickets in JIRA.

17:13 hiredman: *sigh* sure, if I have time this evening

17:45 Borkdude: I have a clojure project that I didn't use for some time, it got started with a script in folder script/run.clj

17:46 but apparently lein run script/run.clj doesn't work anymore

17:46 what's the best way to fix?

17:46 bdesham: Borkdude: it's an old leiningen project?

17:47 Borkdude: bdesham: what is old?

17:48 bdesham: uh... incompatible, I guess :)

17:48 Borkdude: it worked until recently

17:48 I don't know what happened to it actually

17:48 technomancy: the built-in "lein run" is for namespaces on the classpath

17:49 probably you were using the plugin before

17:49 raek: Borkdude: 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:49 Borkdude: technomancy: ah, that's it I guess, let me check

17:50 raek: Borkdude: 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:51 (or add :main foo.bar to the project.clj and skip the -m foo.bar part)

17:53 Borkdude: technomancy: if I put the plugin back into the dev-dependencies should "lein run <file>" work?

17:56 technomancy: it should

18:02 but it would be best to move the code to a -main function on the classpath

18:06 Borkdude: ok, well the old behavior isn't working anymore with the lein-run plugin, but I'll move it to a -main, tnx

18:07 technomancy: there was briefly a version of 1.4.x that had built-in tasks shadow plugins, but it was fixed pretty quickly.

18:08 Borkdude: I'm using 1.5.2

18:24 kencausey: I'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:25 specifically lein plugin install is putting the files in the wrong place

18:25 technomancy: kencausey: ah, I had some bug reports on that earlier but they didn't include enough detail

18:25 so is (System/getProperty "user.home") wrong?

18:25 kencausey: OK, I would be happy to help provide info, a moment...

18:26 I've got to figure out how to start clojure first ;)

18:26 offby1: that's the hard part, in my experience

18:27 technomancy: java -cp ~/.lein/self-installs/TAB clojure.main

18:28 kencausey: all that's in self-installs is leiningen-1.5.2-standalone.jar

18:28 technomancy: that'll do

18:28 kencausey: oh right

18:28 java.lang.NoClassDefFoundError: clojure/main

18:29 I need a CLASSPATH or something?

18:29 * offby1 smells someone who is as ignorant of Java as he is

18:30 kencausey: absolutely

18:30 technomancy: no, -cp should do it. suspect that jar is not what it claims to be

18:30 kencausey: perhaps the issue is a cygwin/dos thing?

18:31 technomancy: quick workaround fix would be to symlink $USERPROFILE/.lein to $HOME/.lein I guess

18:32 kencausey: trying that

18:33 __name__: or to use a proper os

18:34 * __name__ hides

18:34 kencausey: I normally do, but development of projects from multiple systems requires using less preferred systems sometimes

18:34 * technomancy usually assumes such arrangements are not by choice

18:35 kencausey: technomancy: oh your blog mentioned 1.4.0 in the video but 1.3.1 in the text, does it matter which is used?

18:35 technomancy: kencausey: either will do

18:35 1.3.1 is preferred if you want a stable version, while 1.4.0-SNAPSHOT has new debugger features

18:35 kencausey: I'm willing to bleed a bit to start with anyway

18:39 Borkdude: I'm trying out the clojure app on heroku thing

18:39 kencausey: I think java doesn't like my symlink

18:39 Borkdude: I wonder where I can find documentation about the cedar stack and support of clojure

18:39 kencausey: Installing shell wrapper to C:\Documents and Settings\Ken\.lein\bin\swank-clojure

18:39 Exception 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:40 Borkdude: and also: someone maybe has a clue why this goes wrong? https://gist.github.com/1003529

18:49 technomancy: Borkdude: maybe a timeout? there could be a limit on how long processes may take to launch?

18:54 seancorfield: oddness... i had a (ns) decl where i accidentally missed the : off the require keyword... but it still seemed to work...? known undocumented behavior?

18:58 ataggart: could you reference vars in the other ns?

19:02 Borkdude: technomancy: could be...

21:44 hiredman: dnolen: cond-m used to create a pattern matchy fn equiv used to implement a secd machine https://gist.github.com/1003761

21:46 dnolen: hiredman: wow cool! :)

21:48 hiredman: I 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:53 dnolen: hiredman: 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:53 hiredman: it's all I've got

21:53 danlarkin: THAT'S NOT TRUE HIREDMAN


21:54 hiredman: I certainly don't want to implement pattern matching, I just want to use it

21:54 danlarkin: thanks dude

21:54 there are a number of other implementations for clojure, but they all seem to be disgusting

21:55 one of them uses eval to generate fns so it destroys the ability to recur

21:55 ugh

21:57 chouser: is there any way to get clojure maven plugin to include the test files in the classpath for clojure:repl ?

21:58 dnolen: hiredman: 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:58 danlarkin: chouser: I'm going to BM and say why the heck are you using the clojure maven plugin

22:00 chouser: I'm working on clojure.data.xml

22:00 hiredman: lein needs a way to ingest a pom.xml and spit out a project.clj

22:00 danlarkin: ah, so because SS likes maven

22:01 sorry, I know that's not helpful. No I don't know how :-/

22:04 chouser: merely out of curiosity, do you know the answer to the equivalent lein question?

22:05 hiredman: I believe tests are on the classpath for lein repl and lein swank

22:05 danlarkin: I think they're on the classpath for lein repl already

22:06 hiredman: they definitly are for lein swank, but I never use lein repl

22:30 chouser: bleh. I don't see how it's possible

22:32 ah. symlink. well, that'll do. *sigh*

22:35 slander!

22:35 clojure:repl does include tests by default, no symlink needed.

22:35 I had a typo. :-P

22:41 hiredman: I'd like to blame clojure maven plugin for your typo, so I will

23:17 technomancy: danlarkin: BM?

23:18 * technomancy only knows one term that abbreviates to BM

23:18 hiredman: business machines?

23:18 danlarkin: bad manner, a common term used to describe poor sportsmanship in electronic sports, often abbreviated to "bm"

23:19 technomancy: so not bowel movement then. that's good.

23:19 * technomancy wonders if there's a way he could make the DEPRECATED: notice on https://github.com/technomancy/clojure-http-client more obvious

23:19 technomancy: github needs to support the <blink> tag

23:21 is there a reasonable use case for setting user-level mvn repositories?

23:21 seems like it's just a recipe for http://www.codeodor.com/images/works-on-my-machine-starburst.png

23:24 hrm; I'll just stash this until someone talks me into it

23:51 kornys: Hi - 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:52 I seem to have been allocated a single worker, which is costing me 5c an hour...

23:53 pretty cheap for a simple demo, but not something I'd like to leave up for a long time.

23:56 &(* 0.05 24 30)

23:56 sexpbot: ⟹ 36.00000000000001

Logging service provided by n01se.net