#clojure log - Jun 26 2010

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

0:11 hiredman: last var wins is really dumb

0:12 cemerick: hiredman: what's your reason?

0:13 hiredman: when I try to reload/compile a file in slime it complains that the functions I have defined have *already* been defined in the namespace I am trying to redefine them in

0:13 Raynes: The fact that you can't turn it off is enough.

0:14 hiredman: all that last var wins has ever done for me is cause grief

0:14 the other day I could load some tests that used ring because they did a :reload-all

0:14 defn: hiredman: yeah I have the same issue all the time

0:14 hiredman: couldn't

0:15 I had to put a (ns-unmap (create-ns 'clojure.core) 'spit) at the top of the file

0:16 cemerick: that sounds like a bug IIUC; you should be able to redefine vars in your own ns at any time

0:17 FWIW, I redefine vars all the time...maybe it's a slime issue?

0:18 hiredman: it's a complication of the model via the addition of well intention complications to make things "easier"

0:23 Raynes: http://github.com/liebke/clj I just noticed this. This is awesome.

0:27 defn: Stolen from my twitter feed no doubt ;)

0:27 Raynes: defn: Totally. Thanks for mentioning it.

0:28 defn: :) Happy to. It looks really interesting. Obviously liebke has a pretty great track record when it comes to Clojure software.

0:28 I can see how a simple Emacs interface could be writtin for it

0:28 written

0:29 since it will return the classpath and so forth

0:29 anyone could write nice interface for it really

0:29 like with anything Java + classpath I bet there are some (a lot) of caveats

0:40 tomoj: clj scares me

0:42 technomancy: it's a little too ambitious. I'd rather have something simpler that could be included in Clojure itself in the future.

0:43 defn: agreed

0:44 tomoj: is it not meant for developers?

0:49 I mean, why `clj install`? only meant for tinkerers who don't want to set up real clojure projects?

0:49 defn: maybe it grabs the most recent?

0:49 Raynes: It shouldn't be that hard to write a simpler thing to be included in Clojure. I'm surprised that *some* sort of script hasn't already been written.

1:03 brandonw: if i use nailgun as a clojure repl server, and background the process, is it normal for anything calling the server to block until i foreground the server process?

1:04 i could have sworn i backgrounded the nailgun server months back without a problem.. i don't think i am doing anything differently now

1:04 tomoj: how are you backgrounding the process?

1:04 brandonw: ctrl-z

1:05 and `lein nailgun &`

1:05 both seem to do the same thing

1:05 tomoj: the latter sounds right

1:05 for the former I would think you'd need to `bg`

1:06 brandonw: oh okay

1:06 let me try that

1:06 okay, yes you are correct

1:07 i guess that makes me a linux newbie still, heh

1:07 never realized that there was a distinction between `cmd &` and `cmd` then ctrl-z

1:07 thanks :)

1:08 tomoj: `fg` to get it back

1:10 defn: :)

1:13 bobo_: ö-äääääääääääääääääääää

1:13 ö-äääääääääääääääääääää

1:51 yacin: technomancy: thanks!

5:54 rustemsuniev: Does anyone know how to remove a map element with defined x, y from the vector like this?

5:54 [{:x 0, :y 1} {:x 1, :y 0}

6:04 tomoj: rustemsuniev: huh?

6:11 noidi: ,(remove #(= {:x 0 :y 1} %) [{:x 0, :y 1} {:x 1, :y 0}])

6:11 clojurebot: ({:x 1, :y 0})

6:11 noidi: do you mean something like that?

6:15 rustemsuniev: noidi: Yep, thanks!

6:19 If I define a vector as (def my-vec (ref [{:x 0, :y 1} {:x 1, :y 0}])) how I can make the same remove work?

7:00 helino: hello everyone! i've just started learning clojure and have a question about Leiningen. Which folders in the project layout are "binary" folders? What's the "classes" folder?

8:50 hello everyone! for network programming with clojure, which library would you recommend? server-socket in clojure-contrib?

9:14 bhenry: can someone give me a working link to ants.clj?

9:15 found it. ]

9:25 raek: helino: server-socket and clojure.contrib.io/clojure.contrib.duck-streams are a good start

9:31 I also recommend looking into lazy sequences

9:32 they can be very handy for representing the incomming (maybe tokenized) data as a stream/sequence

10:04 helino: raek: ok, thanks for your answer!

11:26 toked: is clojure.repl meant to replace contrib.repl-utils? or is the idea to pull just the most commonly used functions into the core lib?

13:25 systay: I'm stuck. If anyone feels like helping a noob out, take a look at this: http://gist.github.com/454199

13:25 I'm using neo4j, and the error I get from that declaration is: "java.lang.RuntimeException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol (data.clj:6)"

13:25 qbg: You need arguments for defn

13:27 (defn create-root [...] (with-tx ...))

13:27 systay: I feel really stupid now. Can we just pretend I never asked? :)

13:27 polypus: asked what?

13:27 ;)

13:27 qbg: Internet knows all

13:28 * systay goes and makes some coffee. He obviously needs it.

13:28 qbg: It could be worse; the other day I had a brain fart regarding syntax-quote

13:38 systay: has anyone tried pair programming clojure? I'm curious

13:39 qbg: I did a little once with someone who didn't know clojure, but that's it.

13:39 systay: I was thinking it must be very different from pairing on a verbose language like java

13:43 qbg: How so?

13:45 systay: well... in a c# (my primary lang), when I'm backseat, I think about the "big picture" while my pair buddy does the boring typing

13:46 I'm just curious

14:01 I'm trying to get my repl to reload when a file changes...

14:01 i write (use :reload-all 'src-file)

14:02 but that doesn't seem to work... am I missing something?

14:05 chouser: that should work if by src-file you mean my.namespace

14:07 systay: and if I add a definition to that file, and save it, will it be picked up automagically?

14:20 raek: seems like i'm doing (into {} (for [x xs] [(make-key x) (make-val x)])) all the time...

14:20 is there some better/more ideomatic/prettier way of doing this?

14:37 qbg: raek:

14:37 ,(doc juxt)

14:37 clojurebot: "([f] [f g] [f g h] [f g h & fs]); Alpha - name subject to change. Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]"

14:38 ober: anyone got clojure working on android?

14:38 qbg: There is a thread on the group about clojure on android

14:39 ober: yeah saw that and was prompting me to hunt for a howto or something

14:39 qbg: This thread seems relevant: http://groups.google.com/group/clojure/browse_thread/thread/737a69393a5b111e/4fbaa8c8695e90e9?lnk=gst&q=android#4fbaa8c8695e90e9

14:47 kiras: anyone have any suggestions on how this could be better? http://gist.github.com/454257

14:49 ataggart: use filter

14:50 kiras: ataggart: ok, let me try that

14:50 ataggart: ah sry that was with regard to the comment at the top, not the fn to see is soemthing is divisible by a number

14:51 for that: (zero? (mod x 3))

14:55 kiras: ataggart: sorry, i don't understand what you mean. i don't actually check to see if something is divisible by a number, are you saying that i should?

14:55 ataggart: isn't that part of the problem?

14:55 you need to test if a number is divisible by 3 or 5

14:57 kiras: well... the problem is to sum up all the multiples of 3 or 5 under 1000, which i already know is divisible by 3 and 5, so i don't *have* to test that, but i probably should anyway heh

14:58 ataggart: e.g., (reduce + (filter #(and (zero? (mod % 3)) (zero? (mod % 5))) (range 1000))

14:59 )

15:01 kiras: i think for this problem, it would be or instead of and

15:01 ataggart: so it is

15:02 but notice the difference in structure between yours and mine

15:03 kiras: they are definitely different. what aspect in particular are you referring to?

15:03 ataggart: composing together functions that work on sequences

15:04 rather than writing every detail in a loop

15:04 imperative vs functional, basically

15:05 kiras: that will probably take me a while to get used to

15:05 ataggart: heh, perhaps

15:05 kiras: in some ways, i thought that part of what i did was sort of functional

15:05 ataggart: it took me a bit to wrap my head around it

15:05 kiras: the part using the results of the divide-by-n-list results?

15:06 ataggart: it's the mental model. In yours you're given an end number and keep doing some math on it.

15:06 it's entirely specialized

15:07 whereas if you think of the starting data as a list of all the numbers between 0 and 999, then you process that sequence with various functions

15:07 all which are non-specialized

15:08 kiras: i see what you mean

15:10 mine is also wrong, since i accidentally included 1000 in the divisible by 5 list

15:10 ataggart: also the one I pasted reads much like the problem: sum the set of numbers which are divisable by 3 or 5 where all numbers are in the range of 0 to 999

15:11 kiras: true

15:11 systay: I'm finding that I have good use of my dba-background. "Good" SQL is also set-based and not looping

15:12 in re: to your discussion

15:12 ataggart: true, though I loathe sql

15:12 kiras: maybe i'll try another problem and try to keep this in mind

15:13 ataggart: kiras: break the problems down into discrete sub-problems (i.e., functions)

15:13 and then compose them

15:13 e.g., a fn that tests for divisibility by 3

15:14 cemerick: rhickey: ping?

15:15 systay: what does this mean: #<Object$RelationshipType$c9c4a4fe neo4j.proxy$java.lang.Object$RelationshipType$c9c4a4fe@1c54796>

15:15 qbg: It is an object

15:16 systay: how do I read it?

15:16 I mean that string

15:16 qbg: You want to read in "#<...>"?

15:17 systay: well, I want to learn how to decode the repl-output

15:17 it contains some data, and I want the decoder ring for it

15:17 qbg: First, #<...> is the syntax for an unreadable object

15:17 So you can't just type it in to get the object

15:18 If that is the last output from the REPL, *1 will be bound to it.

15:19 How are you getting the object?

15:19 systay: I'm reading all relationships from the top-node in neo4j: (relationship (top-node))

15:23 qbg: I'd suggest taking a look at the neo4j java docs

15:23 systay: yeah, I'm reading them...

15:24 It's just the combination of two unknowns - clojure and neo4j that's messing me up

15:24 qbg: The object is an instance of a subclass of RelationshipType

15:28 If you are using clojure-neo4j, it looks like the relate function could be useful.

15:28 systay: ah... so I'm getting the relationship types, and not the relations...

15:29 qbg: thanks so much. I'll continue digging. I got the relate part working, now I want to read as well :)

15:50 mmarczyk: kiras: I wonder if this can help to stay within the realm of nicely composing blocks, yet not test divisibility for the "multiples of 3 & 5" problem: http://gist.github.com/454287

15:51 (reduce + (take-while #(< % 1000) (apply merge-seqs (map (fn [n] (iterate #(+ % n) 0)) [3 5]))))

15:58 kiras: mmarcyzk: i'm looking, but it will probably take me a while to understand this

15:59 LauJensen: Good evening gentlemen

15:59 ataggart: is it evening already?

15:59 qbg: Depends on where you live...

16:00 mmarczyk: kiras: updated the Gist to work with comparable stuff which isn't numeric

16:00 LauJensen: good evening to you!

16:00 kiras: it's the merge part of merge sort, basically

16:02 LauJensen: Sorry I meant Good morning (UGT) :)

16:02 mmarczyk: :-)

16:03 qbg: mmarczyk: merge-seqs looks good to me

16:04 mmarczyk: qbg: thanks; made yet another update just now so it's slightly prettier (I hope)

16:10 amatos: How do I convert a seq to a map? I have a map, I want to apply a function to each of its key-value pairs (that is easy using the map function), but that returns a seq, not a map. How do I make that a map?

16:10 qbg: (into {} (map identity {:a 1, :b 2, :c 3}))

16:11 ,(into {} (map identity {:a 1, :b 2, :c 3}))

16:11 clojurebot: {:a 1, :b 2, :c 3}

16:12 mmarczyk: ,(into {} {:a 1, :b 2, :c 3})

16:12 clojurebot: {:a 1, :b 2, :c 3}

16:13 mmarczyk: sorry, just checking something... had a (wrong) hunch

16:13 amatos: thanks! Didn't know about the into function. That seems to do what I need. Cheers

16:14 So the type that into returns is always the type of the to argument?

16:14 mmarczyk: right

16:14 amatos: great, thanks

16:14 mmarczyk: so if you might be dealing with sorted maps, you could use

16:15 ,((fn [m] (let [e (empty m) res (map identity m)] (into e res))) (sorted-map :a 1 :b 2 :c 3))

16:15 clojurebot: {:a 1, :b 2, :c 3}

16:17 amatos: great

16:19 LauJensen: $(letfn [(f [x] (inc x))] (reduce #(assoc %1 (key %2) (f (val %2))) {} {:a 1 :b 2 :c 3}))

16:19 sexpbot: => {:a 2, :b 3, :c 4}

16:20 LauJensen: amatos: thats another way to apply a function to the values, without going through map and into

16:21 the 'letfn' just being to show you that its an arbitrary function

16:21 amatos: oh alright

16:21 thanks

16:28 itistoday: where is it recommended to get clojure 1.2 from? is it the 'new' branch of http://github.com/richhickey/clojure ?

16:29 mmarczyk: itistoday: master

16:29 itistoday: mmarczyk: thanks

16:29 mmarczyk: itistoday: plus see the ggroup -- http://groups.google.com/group/clojure -- for a number of threads on changes currently taking place on other branches, notably equiv

16:30 itistoday: mmarczyk: ok, yeah i need to re-subscribe, i've finally decided to go headfirst into clojure

16:30 mmarczyk: itistoday: way to go! :-)

16:31 systay: is there a way to clear the screen while in repl?

16:31 itistoday: mmarczyk: yeah, i'm excited and a little scared, as it means i have a lot to learn... how would you recommend pulling from rhickey's repo if you just want to get the 1.2 stuff that includes datatypes, and you don't want to waste a whole bunch of hard drive space?

16:32 kiras: systay: in emacs? you can use C-c M-o.

16:32 mmarczyk: itistoday: the whole thing is ~47M

16:33 itistoday: mmarczyk: oh, ok that's not bad

16:33 systay: kiras: nah... learning clojure is enough in it self. I'm using trusted old gedit so far

16:33 mmarczyk: itistoday: anyway, just use git clone and maybe stay on master for now

16:33 systay: kiras: so just a terminal repl

16:33 itistoday: mmarczyk: k

16:33 kiras: systay: ah. sorry, i don't know then.

16:34 mmarczyk: systay: in that case, look to your terminal for that

16:35 systay: mmarczyk: of course... duh! thanks...

16:36 mmarczyk: systay: :-) e.g. Gnome Terminal has a 'Reset and Clear' command in the 'Terminal' menu; kills your prompt too, but not the app, plus the last batch of input is still there

16:37 so use at an empty prompt followed by return to get a mostly-cleared screen with a fresh prompt

16:37 yacin: does clojure 1.2/contrib 1.2 not work with swank?

16:37 i'm getting this error: http://osdir.com/ml/clojure/2010-02/msg00797.html

16:37 mmarczyk: yacin: it works fine, though you might need a fresh-enough swank

16:37 systay: mmarczyk: yeah, I found it straight away once I started looking for it...

16:37 rustemsuniev: If I have (def my-vec (ref [{:x 0 :y 1 :val false} {:x 1 :y 0 :val false}])) how I can update a map in it with a value "val = false" say for x 1, y 0?

16:38 mmarczyk: yacin: aahhh, you're being hit by the old contrib-compiled-with-different-clojure.jar problem

16:38 yacin: you need to use a clojure-contrib.jar matching your clojure.jar

16:38 systay: :-)

16:38 yacin: i'm pulling both from clojars

16:39 although it's 1.2.0-master-SNAPSHOT for clojure and 1.2.0-SNAPSHOT for clojure-contrib

16:39 mmarczyk: and for swank?

16:39 yacin: leiningen/lein-swank "1.2.0-SNAPSHOT"

16:41 mmarczyk: (let [my-vec (ref [{:x 0 :y 1 :val false} {:x 1 :y 0 :val false}])] (dosync (alter my-vec (partial clojure.walk/walk #(if (and (== (:x %) 1) (== (:y %) 0)) (assoc % :val false)) identity))

16:41 ,(let [my-vec (ref [{:x 0 :y 1 :val false} {:x 1 :y 0 :val false}])] (dosync (alter my-vec (partial clojure.walk/walk #(if (and (== (:x %) 1) (== (:y %) 0)) (assoc % :val false)) identity))))

16:41 clojurebot: java.lang.ClassNotFoundException: clojure.walk

16:41 mmarczyk: rustemsuniev: see above

16:42 rustemsuniev: Cheers! Going to try it.

16:42 mmarczyk: yacin: try a lein clean and lein deps again maybe...?

16:43 plus I'd bump swank's version to 1.3.0 if that's on Clojars already

16:43 rustemsuniev: ah, sorry, missed the other branch of the if... just use %

16:43 kiras: i've been using swank-clojure "1.2.1" instead of leiningen/lein-swank "1.2.0-SNAPSHOT"

16:43 not sure if that's right or not, but it seems to work for me

16:44 rustemsuniev: Sure! thanks again!

16:45 mmarczyk: rustemsuniev: plus it would be better to (assoc % :val true) to see that it works, seeing how the original values are already false :-)

16:46 yacin: kiras: as a :dev-dependencies?

16:46 kiras: yacin: yes

16:47 yacin: doesn't let swank start problem with M-x swank-clojure-project for me...

16:47 kiras: from the site: Note that the lein-swank plugin now comes with Swank Clojure; it does not need to be specified as a separate dependency any more.

16:47 ah... i think they say that it's better to use lein swank at the command line first, then slime-connect

16:48 instead of swank-clojure-project

16:50 yacin: ah, that worked just fine

16:50 kiras: cool

16:51 yacin: thanks!

16:51 is there anyway to specify a port for swank?

16:51 kiras: np :)

16:51 yacin: so i can have multiple lein swanks?

16:51 mmarczyk: lein swank port-number, I think

16:51 kiras: $ lein swank [PORT=4005] [HOST=localhost]

16:51 sexpbot: Command not found. No entiendo lo que estás diciendo.

16:52 LauJensen: sexpbot: hablar espanol?

16:52 sexpbot: Command not found. No entiendo lo que estás diciendo.

16:52 mmarczyk: ah, lying with a straight face

16:54 kiras: mmarcyzk: i think i finally understand how that code works lol

16:56 mmarczyk: kiras: :-)

16:56 Raynes: I should consider changing the primary prepend. $ is too common. Dollars and such.

16:56 systay: if I wanted to change how the attribute lookup works, how would I do that?

16:57 I want :foo to mean something other than the normal attribute lookup does

16:57 mmarczyk: Raynes: maybe also require using whatever you choose for s/foo/bar/ style substitutions

16:57 Raynes: mmarczyk: Huh?

16:57 Oh.

16:57 mmarczyk: s/Huh?/Sure!/

16:57 qbg: systay: You want :foo to be a function that does something else?

16:57 kiras: mmarcyzk: that's actually pretty cool... so in the example at the end, it basically creates three lazy sequences, then you merge them into one lazy sequence and take the first 15 elements?

16:57 Raynes: The idea is to not use a prepend.

16:58 mmarczyk: kiras: yup

16:58 Raynes: That plugin isn't loaded right now, I don't think.

16:58 Erik was working on some stuff in that one.

16:58 systay: qbg: In neo4j, a lookup returns a proxy object. if I do (:name proxy-object), I get nil back. I have to do (:name (properties proxy-object)) instead, and that bothers me

16:58 mmarczyk: kiras: as mentioned above, you can merge (iterate #(+ % 3) 0) with #(iterate #(+ % 5)), then (take-while #(< % 1000) ...) from that

16:59 kiras: (reduce + ...) / (apply + ...) to top it off

16:59 Raynes: But we have a $sed command that does the same thing with more functionality. s/// not requiring a prepend is a bit of a fun easter egg. It can be turned off if people find it annoying though.

16:59 <3

16:59 mmarczyk: kiras: if you use ->>, you can actually write it down in a piped fashion

16:59 qbg: systay: Keywords are not variables, so that won't work by itself

17:00 You could always do macro magic, though

17:00 mmarczyk: Raynes: nah, I don't really mind, though as far as usefulness is concerned, hm, I'll look into $sed :-)

17:00 kiras: mmarcyzk: interesting... i'll have to read about ->>

17:00 * qbg loves ->>

17:00 mmarczyk: actually having the bot provide a $sed command is just *cool*

17:00 systay: qbg: I haven't read that chapter in my Programming Clojure-pdf...

17:01 qbg: Either way, it is probably overkill

17:01 mmarczyk: kiras: (->> (map (fn [n] (iterate #(+ % n) 0)) [3 5]) (apply merge-seqs) (take-while #(< % 1000)) (reduce +))

17:01 systay: qbg: it just feels like the clojure-neo4j doesn't hide the fact that we're using a java-lib

17:02 qbg: enough anyway

17:02 qbg: systay: That can be a difficult choice to make when designing a library like that

17:02 systay: I'm sure it is

17:02 qbg: Do we make it like the java library, or do we do something more idiomatic?

17:02 LauJensen: mmarczyk: Im unfamiliar with merge-seqs, what would be passed aorund ?

17:03 mmarczyk: LauJensen: I just wrote it :-) -- http://gist.github.com/454287

17:03 Seqables of Comparables, basically

17:03 systay: qbg: I was just checking if it was doable. Scratching such itches led me to clojure in the first place... :)

17:03 qbg: mmarczyk: One downside of merge-seqs is that you can't use it for mergesort

17:04 mmarczyk: $translate pl en "jejku, fantastyczne! :-)"

17:04 sexpbot: "Oh dear, fantastic! :-)"

17:04 qbg: systay: You have a lot of power with Clojure, and with great power comes great responsibility. :)

17:05 mmarczyk: Raynes: wow, sexpbot has a really cool collection of plugins :-)

17:05 systay: mmarczyk: Cześć

17:05 mmarczyk: qbg: hm? why not?

17:05 systay: o, dobry wieczór :-)

17:05 qbg: mmarczyk: It looks like it swallows items that are equal

17:05 LauJensen: mmarczyk: So it concat seqs on each other, removing duplicates on overlap?

17:05 mmarczyk: qbg: ah, of course

17:06 qbg: could use (cons x (cons x ...)) for the 0 case

17:06 LauJensen: not concat...

17:06 LauJensen: (merge-seqs [1 3 5] [2 4]) => (1 2 3 4 5)

17:06 qbg: mmarczyk: It might be better keep the originals instead of duplicating one

17:07 mmarczyk: qbg: hm, true again

17:07 qbg: (cons x (cons y ...)) for a left-to-right precedence among the input seqs

17:08 kiras: mmarcyk: ->> is really cool, thanks for pointing it out to me

17:08 qbg: Writing a function to remove strings of equal items in a list would be easy

17:08 kiras: how often is ->> generally used?

17:09 LauJensen: kiras: often

17:09 qbg: I use ->> much more than ->

17:09 kiras: laujensen: practically by default? heh

17:09 LauJensen: Almost. If some kind of sequential processing makes more sense using either -> or ->> I rewrite. Its all about readability

17:10 kiras: laujensen: interesting

17:11 mmarczyk: qbg: updated the Gist to contain two versions, merge-seqs which does not remove duplicates and merge-seqs-nub which does

17:11 qbg: thanks for the idea

17:12 kiras: yeah, cool it is :-)

17:12 qbg: mmarczyk: Now there is code duplication. Fix that. ;)

17:12 * mmarczyk gives qbg an icy stare

17:12 mmarczyk: :-P

17:12 qbg: merge-seqs-nub is a composition of two functions, in my mind.

17:13 mmarczyk: sure, could use merge-seqs and distinct

17:13 but distinct needs to build a set of previously seen objects as it goes

17:13 whereas here the point is to exploit the assumptions made about the input

17:13 qbg: Once they are in sorted order, equals ones will appear in a string

17:13 mmarczyk: simple enough to fix, actually, with a helper function -- or rather a macro

17:13 qbg: You can fix that in linear time and constant space

17:14 Function would probably be better

17:14 mmarczyk: which is not quite as not needing to fix it at all

17:14 but sure, it's a good point

17:15 LauJensen: mmarczyk: is it similar to

17:15 $(reduce #(clojure.set/union %1 %2) #{} [[1 3 5] [2 4]])

17:15 sexpbot: => [1 3 5 2 4]

17:15 LauJensen: ?

17:15 mmarczyk: LauJensen: with (sorted-set), right

17:16 LauJensen: k

17:16 mmarczyk: ah, good idea and the actual way to go for the -nub version, I guess :-)

17:16 LauJensen: So wrap it in a call to (set) and you're good to go

17:16 mmarczyk: though actually not quite

17:16 because again

17:16 this builds the whole set

17:16 whereas merge-seqs[-nub] just walks a long the seqs lazily

17:17 outputting one item at a time

17:17 because it knows the inputs to be sorted

17:17 LauJensen: $(take 2 (reduce #(do (println "running") (clojure.set/union %1 %2)) #{} [[1 3 5] [2 4]]))

17:17 sexpbot: => running running (1 3)

17:17 mmarczyk: ^walks along

17:17 LauJensen: So its still lazy, except for the sorting

17:17 But to sort, you need to walk the whole set first

17:17 mmarczyk: which is the whole point

17:18 because the original problem was to add up all numbers divisible by 3 or 5 under 1000

17:18 I wanted to use (iterate #(+ % 3) 0) and (iterate #(+ % 5) 0), then do a duplicate-removing merge

17:18 obviously can't use a set here

17:19 LauJensen: Nope, sorted-set is redundant for data which is incremental in nature

17:20 mmarczyk: $(take 20 (into (sorted-set) (iterate inc 0)))

17:20 sexpbot: java.lang.ClassNotFoundException: clojure.core$iterate$fn__3750

17:20 mmarczyk: huh?

17:20 $(take 20 (into (sorted-set) (range)))

17:20 sexpbot: Execution Timed Out!

17:20 itistoday: what is the relationship of this (http://build.clojure.org/job/clojure/) to rhickey's master branch on github?

17:21 mmarczyk: itistoday: nightly build

17:21 itistoday: mmarczyk: is it based on the master branch or some other branch?

17:21 mmarczyk: master

17:21 itistoday: mmarczyk: ok cool thanks

17:22 mmarczyk: LauJensen: so anyway, "redundant" -- sure, in a very theoretical sense, but you can't use it with infinite seqs

17:25 LauJensen: Its a question of using the right tool for the job. Looks to me like you're trying to model a reality which doesnt exist, ie lazy sorting. For a task that requries sorting, I prefer a combo of reduce and sets, for a task such as the one you describe I wouldnt make it more complicated than it has to be

17:25 Just my 2 cents - hack away :)

17:26 mmarczyk: qbg: updated the Gist with a DRY version -- do you approve? :-)

17:26 LauJensen: I don't sort, I *assume* the inputs are sorted

17:26 LauJensen: as in merge sort -- the merge step knows it works with sorted inputs

17:27 LauJensen: in fact, the original idea for merging was perfectly lazy, because it needed to be in for dealing with tape drives in an efficient manner I guess :-)

17:28 LauJensen: anyway, your idea for a strict duplicate-removing merge with (sorted-set) is cool, so thanks; and I'll welcome any improvements to the lazy version :-)

17:28 qbg: mmarczyk: Note that before you were using compare and now you are using =.

17:29 mmarczyk: qbg: yeah, I thought about it

17:29 qbg: But otherwise, it's better :)

17:30 mmarczyk: I'm trying to figure out if the difference between (zero? (compare x y)) and (= x y) is significant

17:31 ok, inserted the (zero? ...) version

17:31 just to be safe

17:31 LauJensen: mmarczyk: on the master branch ?

17:32 mmarczyk: LauJensen: you mean if I'm targetting master with merge-seqs...? yeah, for now

17:32 LauJensen: mmarczyk: When you're asking questions about '=' I just wanted to know if it was related to the changes in the equal branch or not

17:32 mmarczyk: LauJensen: ah, good point

17:33 qbg: equiv brings back some equality across types

17:33 mmarczyk: actually I'm doing this on an 'equal' REPL

17:34 since I haven't got 'round to building equiv yet... actually might do that now

17:37 TeXnomancy: LauJensen: did you have your clojure studio recently?

17:37 LauJensen: zero? calls x.signum() == 0, and = calls x.equals(y) as far as I can tell.

17:37 TeXnomancy: Yea I just got back from Brussels yesterday as a matter of fact :)

17:37 TeXnomancy: LauJensen: smashing! how'd it go?

17:39 LauJensen: TeXnomancy: I'd say it went great. The team got an IRCBot up and running on the first day, and by the second day they had already written some improvements to Clojure.core, which brought speedups of 20%, so I think people came with a super attitude and energy, and took away some skills because of it

17:41 TeXnomancy: sounds like fun. glad to see the ecosystem is already supporting several of these kinds of things.

17:41 Raynes: mmarczyk: There appears to be a problem with swank servers and clj-sandbox. I suppose some sort of compilation mix up. Either way, iterate and rseq do not work.

17:45 mmarczyk: Raynes: I see... well, no big deal

17:46 Raynes: mmarczyk: It'll probably be fixed if swank gets compiled with 1.2. Assuming it's actually compiled... If not, then I don't know what causes it and I digress. :p

17:46 mmarczyk: Raynes: no aot'd namespaces for swank iirc

17:47 TeXnomancy: mmarczyk: correct

17:47 Raynes: mmarczyk: Well, I can run sexpbot through the shell script and it works fine. I normally run it through a swank server, and when I do that, it meows at you on iterate and rseq.

17:47 I have no clue.

17:47 mmarczyk: wow, weird

17:57 TeXnomancy: any last-minute patches before Leiningen rc2?

17:58 mmarczyk: TeXnomancy: one maybe

17:58 TeXnomancy: :license & Co. in sample.project.clj

17:58 TeXnomancy: I think I've sent you a pull request for that

17:59 TeXnomancy: otherwise it's on add-more-info-to-pom-doc branch in my fork

18:00 Raynes: TeXnomancy: Did you fix the lein repl thing where it always uses 1.1?

18:00 TeXnomancy: Raynes: yeah, several weeks ago

18:00 Raynes: Good boy.

18:00 TeXnomancy: mmarczyk: oh, I thought I had got that one.

18:00 Raynes: <3

18:01 TeXnomancy: mmarczyk: apply'd!

18:01 mmarczyk: TeXnomancy: cool, thanks

18:01 TeXnomancy: there's also the new commit

18:01 'repositories being maps'

18:02 just noticed it

18:02 anyway, could use an example too

18:02 TeXnomancy: mmarczyk: yeah... I'm using the term "RC" to mean "functionally release candidate"

18:02 there are still documentation tasks remaining for 1.2

18:03 mmarczyk: TeXnomancy: fair enough :-)

18:09 TeXnomancy: plenty of changes since RC1: http://github.com/technomancy/leiningen/commit/d94d94db096d690b282f90f3edd5569159ba2cb0

18:11 mmarczyk: TeXnomancy: one more thing

18:12 deps.clj -> make-repository -> second branch of if -> the let form seems to be missing a binding expression

18:13 (let [{:keys [url username password]} settings-goes-here] ...

18:13 TeXnomancy: mmarczyk: dang! you're right.

18:13 I don't have a password-protected repo to test against, but I could have caught that =\

18:13 mmarczyk: :-)

18:18 kiras: so i just figured out that lein new allows you to specify a groupid. i'm not sure when this would normally be used, but last week i was trying to figure out how to use lein to set up a project "test-project" without having dashes where there were supposed to be underscores and vice versa. using the groupid option makes it possible to do this. just wondering, are there any other reasons why this option is useful?

18:19 TeXnomancy: kiras: IMO group-id is not useful. =)

18:19 but some people wanted it and were kind enough to contribute a patch

18:19 kiras: what about in the situation i just described?

18:19 is there a better way to accomplish that?

18:20 TeXnomancy: kiras: well, the JVM can't load files that have a dash in them. it's just a dumb limitation it has.

18:20 that's why they get replaced with underscores.

18:20 mmarczyk: I'm only using group-ids in :dependencies... and then I occasionally switch back and forth between a couple of them (different folks' jars on Clojars)

18:21 kiras: i understand that, i just meant, lein currently doesn't let you make a project correctly like this: lein new test-project, at least not that i'm aware of

18:21 TeXnomancy: oh yeah, you absolutely need group-ids for specifying dependencies on other peoples' projects. I just don't see the point of adding one for your own (other than publishing non-canonical releases to clojars)

18:21 kiras: so it's useful in that situation, at least

18:22 nickik: How can i make this ([1] [2] [3] [4]) out of this ([1] [2]) ([3] [4])

18:22 kiras: i was thinking if there was no other reason for that option in new, wouldn't it be possible to make lein new handle that automatically?

18:22 Raynes: $(concat '([1] [2]) '([3] [4]))

18:22 sexpbot: => ([1] [2] [3] [4])

18:22 kiras: so lein new test-project sets up project.clj and core.clj with test-project and the directories are all test_project?

18:22 mmarczyk: kiras: lein new test-project works fine for me

18:22 kiras: mmarczyk: really?

18:22 ...

18:22 Raynes: $(into '([1] [2]) '([3] [4])) ; back asswards

18:22 sexpbot: => ([4] [3] [1] [2])

18:23 kiras: wonder what i'm doing wrong then

18:23 mmarczyk: the project directory is called test-project, the namespace directory is called test_project, as it needs to be due to JVM issues

18:23 TeXnomancy: kiras: could you describe what it is specifically that you think is wrong?

18:23 Raynes: concat is what you're looking for, nickik

18:23 TeXnomancy: where are you expecting there do be dashes rather than underscores?

18:23 kiras: texnomancy: i thought that when i did lein new test-project it was creating dashes everywhere

18:23 TeXnomancy: so ... I realized leiningen freaks out if I try to run it from my home dir since it tries to put all of ~/src on the classpath... which is like 20+ GB =(

18:24 mmarczyk: kiras: also, how are group-ids of help?

18:24 kiras: both in the directories and the source files

18:24 mmarczyk: TeXnomancy: even with lein new? that would be an 'ouch'

18:25 then again, maybe not... ah, totally uncertain now

18:25 kiras: the dashes need to be replaced with underscores for stuff which will end up on the classpath

18:25 TeXnomancy: kiras: hmmm... actually I vaguely recall a patch addressing that which has been applied in 1.2.0; perhaps you could be the first person to try the latest release candidate?

18:25 kiras: texnomancy: actually... looks like i am wrong... let me check

18:26 TeXnomancy: well you should try the RC anyway; it's really great. =)

18:26 mmarczyk: kiras: for the "outer" directory of the project, they shouldn't be replaced, but at least in HEAD they aren't, so if there was a problem, it's fixed now :-)

18:27 nickik: thx for your anwsers works great

18:27 mmarczyk: TeXnomancy: btw, what's the story behind checkout-deps? I notice it's rather stubby right now :-)

18:28 TeXnomancy: mmarczyk: at first I thought it would be useful as a task, but I don't think so anymore. it will probably be merged into deps.clj since there's no need to have it in its own ns.

18:30 mmarczyk: TeXnomancy: so, is the idea to pull from git repos into project/checkout-deps/foo/ ?

18:30 TeXnomancy: mmarczyk: yeah, lein-generated projects will put their git repo info in the pom (which is included in the jar), so it could do that

18:31 but I'm unsure if that would even be useful... if so it belongs in a plugin

18:31 mmarczyk: maybe an optional hook (hooke?) on the deps task?

18:32 TeXnomancy: possibly

18:33 hmm... I should list the contributors next to the entries in the NEWS file.

18:33 mmarczyk: :-)

18:34 arohner: TeXnomancy: thanks for applying my patch. What's with your name today? Are you working with tex, or hanging out in texas?

18:34 TeXnomancy: arohner: oh, heh... I had some issues with my dircproxy that I need to take a look at; falling back to my alt. nick in the mean time.

18:34 (I am actually not very good at typesetting)

18:36 itistoday: TeXnomancy: is it cool to use leiningen from your master branch, or is that not stable and we should use the RC2 from the Downloads page?

18:36 TeXnomancy: itistoday: right now they are exactly the same. =)

18:36 itistoday: master generally stays very stable; I use it at work every day.

18:37 itistoday: TeXnomancy: ok cool, thanks!

18:37 TeXnomancy: any destabilizing work will be done on a topic branch until it's "ready"

18:37 arohner: oh that is too cool. Metadata for line numbers are attached to the actual forms, so you can use them in macros

18:37 TeXnomancy: itistoday: btw; you shouldn't have to download any jars manually, just get the shell script and have it run self-install

18:37 (unless you're on Windows)

18:37 itistoday: TeXnomancy: yeah i haven't, i've cloned your repo, do i just go in and run ./bin/lein self-install ?

18:38 arohner: but it appears clojure.walk eats metadata :-(

18:38 mmarczyk: arohner: yeah... I remember I didn't get why metadata would be such a big deal when first learning about Clojure *at all*, whereas now I think having them is an *amazing* win

18:38 TeXnomancy: itistoday: should do the trick

18:39 mmarczyk: well, clojure.walk/walk doesn't, but the inner & outer functions would need to preserve them

18:39 there was a thread on the ggroup mentioning this as a bug recently

18:39 TeXnomancy: you don't even need to check it out actually; you can just get the shell script by itself

18:39 mmarczyk: could be considered a bug in prewalk / postwalk, to be sure...

18:40 TeXnomancy: mmarczyk: the last three little hacks I've done have all centered around metadata. it's great!

18:40 mmarczyk: so it is :-)

18:41 TeXnomancy: (robert hooke, serializable-fn, and radagast)

18:42 arohner: TeXnomancy: what is radagast?

18:42 mmarczyk: serializable-fn & radagast? I want to know more!

18:42 arohner: serializable-fn is very clever btw

18:43 TeXnomancy: oh... I haven't really released radagast yet.

18:43 arohner: mmarczyk: (defmacro fn [ & body] (fn {:src body} ~@body)

18:43 TeXnomancy: but I recently decided on that name for http://p.hagelb.org/coverage.clj.html

18:43 mmarczyk: hah, cool :-)

18:43 kiras: texnomancy: it looks like everything is working as it should... but i'm having trouble running the uberjar after i create it... it should just be java -jar test-project-standalone.jar, right?

18:43 mmarczyk: (that was re: serializable-fn... looking at the link now)

18:43 TeXnomancy: mmarczyk: we implemented it at one of the seattle clojure meetings: http://github.com/technomancy/serializable-fn

18:44 mmarczyk: kiras: you'd need to specify a main namespace

18:44 kiras: :main in project.clj

18:44 kiras: plus the namespace itself needs to be :gen-class'ed

18:44 kiras: mmarcyzk: i did, but i'm not sure if it is the right one. i have :main test-project.core

18:45 mmarczyk: TeXnomancy: cool commit message on 1.1.0 :-)

18:45 kiras: and the gen-class?

18:45 (ns test-project.core (:gen-class))

18:45 kiras: mmarcyzk: and the :gen-class is where it should be as well... i had this working last week

18:45 mmarczyk: oh, and you need (defn -main [& args] ...) in there as well

18:46 kiras: mmarcyzk: well, i have (defn -main [] ...)

18:46 mmarczyk: actually, does java -jar work for you with the regular jar? if it does, then it's definitely something funny with uberjar

18:46 kiras: that did work before, although maybe it's wrong

18:46 no, it doesn't

18:47 i'm thinking maybe this was what made me think there was something wrong with the project creation

18:47 TeXnomancy: is it possible even to claim copyright by something as vague as Seajure?

18:49 kiras: wonder if i have the namespace wrong in project.clj...

18:49 mmarczyk: hm, could also replace print-method for fns with one using clojure.repl/source-fn where that is able to find the source

18:50 TeXnomancy: oh, that'd be nifty

18:50 * TeXnomancy would find it a lot easier to proofread books if they came in .mobi

18:51 TeXnomancy: ... just sayin'.

18:51 mmarczyk: TeXnomancy: surely it must be, in fact I would say it gives Seajure an all new existence on the Upper Plane of IP

18:51 TeXnomancy: mmarczyk: you mean IPv6?

18:51 badum-crash!

18:51 mmarczyk: :-P

18:51 TeXnomancy: is it easy to concatenate PDFs?

18:52 mmarczyk: TeXnomancy: apparently not really... http://ansuz.sooke.bc.ca/software/pdf-append.php

18:53 haven't tried all of the solutions listed, but normally I settle for some print-to-file-like approach

18:55 hm, leiningen.coverage would be absolutely awesome

18:56 TeXnomancy: mmarczyk: sorta. it's only fn-level coverage.

18:57 what you really want is branch-level coverage, which would take a lot more than 30 lines to implement. =)

18:57 kiras: ok, so using underscores (e.g. :main test_project.core) in project.clj works for me, but using dashes doesn't. is that as it should be?

18:57 mmarczyk: though currently I find myself writing macros which define a bunch of functions in one go pretty often... (defparsefns SQL "SQL" expression "SQL expression" ...)

18:57 TeXnomancy: wow, actually that ghostscript hack worked

18:57 thakns

18:57 itistoday: what is a good clj script to use? i.e. i've checked out the clojure repos and have a jar file, now i just need a convenient way to run a repl

18:57 mmarczyk: TeXnomancy: oh good :-)

18:57 itistoday: http://github.com/liebke/clj

18:58 itistoday: brand new project -- be an early adopter! :-)

18:58 itistoday: mmarczyk: but isn't that a package manager?

18:58 mmarczyk: itistoday: one of the stated goals is to provide a means to launch repls easily

18:58 clj repl, clj swingrepl

18:58 for a swank server you'd need lein

18:59 lein is an option for a terminal repl too, of course

18:59 itistoday: mmarczyk: hmm... ok, this was actually on my list of things to install and use, i didn't know it was also a "standard way to get a repl"

18:59 TeXnomancy: kiras: interesting... no, it should work with dashes there.

18:59 mmarczyk: well, not really standard quite yet, I guess, but might become one

18:59 TeXnomancy: kiras: could you open an issue on the leiningen github page?

19:00 mmarczyk: kiras: oh, good catch then

19:00 kiras: heh glad i wasn't totally wrong

19:01 mmarczyk: the entry in the jar's manifest should be correct, afaict

19:01 kiras: texnomancy: i think i can do that

19:03 itistoday: mmarczyk: I have clojure installed in ~/.clojure/clojure/clojure.jar, how do I tell clj to use this clojure?

19:03 mmarczyk: itistoday: um, not sure, haven't really investigated clj yet... just skimmed the readme & code

19:03 itistoday: the readme seems quite extensive

19:04 Raynes: mmarczyk: You can start swank servers with clj now.

19:04 mmarczyk: Raynes: oh cool, thanks for the heads up

19:04 Raynes: mmarczyk: That was actually added just a few hours ago, actually.

19:04 actually :p

19:05 mmarczyk: that's actually good to know, anyway ;-)

19:08 kiras: so you say that :main test_project.core works for you?

19:08 kiras: it doesn't seem to work for me

19:08 mind you, :main test-project.core doesn't either

19:11 kiras: mmarcyzk: yes, it works for me

19:11 strange... i really hope i'm not doing something stupid and overlooking it

19:13 itistoday: ok, so for now, until i figure out how to get clj to use a different clojure.jar file, is there any other popular clj script for simply running a repl?

19:13 or do most people simply write their own?

19:14 qbg: I don't know about others, but I wrote my own

19:16 It isn't that hard to write a simple one

19:16 itistoday: qbg: it can be daunting if you haven't used java in several years :-p

19:17 qbg: Simple usage is java -cp <classpath> <java options> clojure.main

19:18 Where <classpath> contains clojure.jar, and any other goodies you like (like clojure-contrib)

19:20 itistoday: i think i'll just modify this: http://github.com/russolsen/dejour/blob/master/bin/clj

19:20 mmarczyk: itistoday: just a sec, I'll Gist my own

19:21 itistoday: http://gist.github.com/454436

19:21 qbg: Python, eh?

19:21 mmarczyk: more palatable than bash :-)

19:22 itistoday: mmarczyk: thanks! I might write a newlisp version then :-D

19:22 mmarczyk: (based on yours)

19:22 mmarczyk: itistoday: that would be cool :-)

19:23 itistoday: i guess writing a clj file is a sort of an initiation into clojure that n00bs must go through :-p

19:24 mmarczyk: kiras: actually I notice I've been doing sth remarkably silly all this time

19:24 kiras: is this ok for a title for the github issue or would something else be preferred? project-name + project.clj :main project-name.core + lein uberjar + java -jar standalone jar = java.land.NoClassDefFoundError

19:24 mmarczyk: kiras: having fixed that, java -jar ... works for me with uberjar-created jars

19:24 kiras: um, I'd say something else would be preferred ;-)

19:24 kiras: sth == something?

19:25 mmarczyk: yup

19:25 qbg: mmarczyk: Now I have an urge to a clj script in Clojure

19:25 kiras: do you mean that this issue doesn't exist for you having fixed the sth silly you were doing?

19:25 mmarczyk: qbg: called ouroboros, presumably? ;-)

19:25 kiras: apparently

19:25 kiras: just one more thing to check to be sure

19:26 kiras: because I might be masking it

19:26 kiras: mmarcyzk: ok, please let me know if you've solved it

19:26 mmarczyk: kiras: will do in a second

19:26 kiras: yeah, seems to work for me

19:27 kiras: could you make a Gist of your test-project (directory layout + project.clj + your main namespace)? maybe I'd spot sth

19:28 kiras: mmarczyk: sure, might take me a few minutes

19:29 mmarczyk: kiras: no problem, planning to hang around for a while yet

19:29 kiras: ok

19:35 mmarczyk: http://gist.github.com/454449 let me know if this isn't sufficient

19:36 mmarczyk: kiras: looking now

19:40 kiras: ok, I replicated your layout, ran `lein deps` then `lein uberjar`

19:40 kiras: and java -jar ...-standalone.jar works fine

19:40 kiras: mmarcyzk: hm... ok... let me try "lein deps" and "lein uberjar" again...

19:40 mmarczyk: java -jar slim-jar doesn't, because it doesn't have the Clojure runtime on the classpath

19:42 kiras: mmarczyk: i still can't get the standalone jar to run with java -jar ...-standalone.jar

19:43 mmarczyk: kiras: I should note that I'm using lein's HEAD... not sure what issues might be present in earlier versions

19:43 kiras: mmarczyk: ah... i think i'm still using 1.1.0

19:44 mmarczyk: kiras: could you try out the HEAD?

19:45 kiras: mmarczyk: sure, if you don't mind telling me how to. i only see 1.1.0 and 1.2.0-RCs 1 and 2 at http://github.com/technomancy/leiningen/downloads

19:45 mmarczyk: RC2 will do

19:45 kiras: ok

19:46 mmarczyk: it's behind by one commit, which is a bugfix, but unrelated to this

19:47 kiras: ok this will likely take me a bit to get setup, as i'm on windows... hopefully i won't need to reboot.

19:48 mmarczyk: TeXnomancy: the link in your announcement is to RC1 :-)

19:49 kiras: oh, I think you should just get lein.bat

19:49 for RC2

19:49 and tell it to self-install

19:49 TeXnomancy: mmarczyk: noooo... not again. =(

19:49 kiras: ah, didn't realize the new lein.bat could self-install

19:49 TeXnomancy: actually... I don't think it can. =(

19:50 kiras: T_T

19:50 mmarczyk: oh :-(

19:50 TeXnomancy: :-)

19:50 TeXnomancy: still waiting for someone to port that. not sure how well lein.bat will work with the release candidate; sorry.

19:50 mmarczyk: TeXnomancy: does the RC2 jar include the 'missing local' fix?

19:50 kiras: back to setting up environment variables by hand again, with the dialog with the textline that you can't expand :(

19:50 TeXnomancy: mmarczyk: it does

19:51 mmarczyk: oh, ok then

19:51 kiras: actually I'd get the lein.bat

19:51 kiras: try to run it on a project

19:51 kiras: then hopefully it would complain about lein's jar missing *at some path*

19:51 TeXnomancy: for past releases, Rob Wolfe helped with getting the Windows side working... I should ask him if he could help for this one too.

19:51 kiras: mmarczyk: you mean without updating the jars?

19:51 mmarczyk: then you could put it there

19:51 kiras: ah

19:51 TeXnomancy: unless someone else volunteers, of course.

19:51 * TeXnomancy glances around

19:52 mmarczyk: if it doesn't complain, then presumably the old location will do

19:52 kiras: well, i was trying to keep it set up like, /leiningen/1.1.0 /leiningen/1.2.0

19:52 instead of just copying over stuff... maybe that's a bad idea though

19:53 mmarczyk: kiras: if the lein.bat from 1.1.0 doesn't mind that, the one from HEAD shouldn't either

19:54 kiras: mmarczyk: sorry, i don't understand what you mean by that... if the lein bat from 1.1.0 doesn't mind what?

19:54 mmarczyk: kiras: your current placement of the jar

19:55 kiras: I guess I might not understand what kind of setup you have in mind, though... haven't tried all this on Windows

19:55 kiras: ah... i wouldn't expect it to, barring any changes, but i thought it would be a good idea to keep the various version of leiningen organized so that i could use different ones as needed

19:55 but i guess it doesn't really matter

19:55 mmarczyk: kiras: well, I do have lein-stable set up separately, using the latest release version

20:00 kiras: mmarczyk: ok, switched my environment variables, now running lein at all gives errors... think this happened the last time i tried this too, probably have to reboot.

20:01 mmarczyk: kiras: :-(

20:01 kiras: hehe

20:01 brb

20:17 mmarczyk: back

20:17 mmarczyk: kiras: better luck after the reboot?

20:18 kiras: lein is working now, my initial attempt at a successful uberjar run was unsuccessful though

20:18 maybe i should try with a new project

20:20 mmarczyk: kiras: nah, just do a lein clean

20:20 kiras: mmarczyk: ok

20:23 mmarczyk: lein builds the jars successfully, but i seem to be getting the same error at runtime

20:24 also, a clojure.lang.LispReader$ReaderException is thrown during the lein uberjar

20:24 mmarczyk: :-(

20:24 and what does `lein version` say?

20:24 just to be sure

20:24 kiras: Leiningen nil on Java 1.6.0_20 Java HotSpot(TM) Client VM

20:24 :P

20:25 mmarczyk: nil? whoa :-P

20:25 it's 1.2.0-RC2 for me

20:25 kiras: yeah, that command has never seemed to work for me on windows

20:25 mmarczyk: oh well

20:25 kiras: heh

20:26 any ideas?

20:26 mmarczyk: ho-hum. thinking about it, but no ideas so far

20:26 kiras: heh

20:26 mmarczyk: :-/

20:27 ah, the joys of cross-platform compatibility

20:28 kiras: write once...

20:28 mmarczyk: yeah.

20:29 ... crash in some of the places

20:29 kiras: what's the exception message?

20:29 kiras: the lein uberjar one?

20:30 or the runtime one?

20:32 mmarczyk: both, I guess

20:33 kiras: mmarczyk: ok, i'll post them

20:33 mmarczyk: in this case, maybe include the stack traces too, just in case

20:34 kiras: ok, i thought that was what you wanted, actually

20:35 mmarczyk: ah, I meant just the exception message originally, if there is one... but the full stacktrace idea is better

20:36 kiras: ok

20:39 mmarczyk: http://gist.github.com/454496

20:40 mmarczyk: ohhhh........

20:40 kiras: ohhhh?

20:40 mmarczyk: starts to make sense

20:41 does it only happen with uberjar

20:41 or with, say, lein clean too?

20:42 kiras: lein clean is fine

20:42 mmarczyk: and lein jar, lein compile, lein deps?

20:42 hm, every task really

20:42 kiras: let me try

20:43 lein jar looks like it's giving the same reader error as uberjar

20:43 mmarczyk: good :-)

20:43 kiras: heh

20:43 mmarczyk: could you have a look at the others?

20:44 though I think I have an idea as to where the problem might be

20:44 with some blank spaces remaining, though...

20:44 kiras: lein compile: reader error lein deps: java.io.IOException...

20:45 i could post that to the gist as well, if you like

20:45 mmarczyk: yes, please

20:47 kiras: mmarczyk: ok, updated it with the deps error... when you said "all of the tasks" did you literally mean all of them?

20:48 mmarczyk: well, I hate to ask, but... :-)

20:48 kiras: heh

20:50 mmarczyk: hm, the IOException is funny... an issue with permissions maybe? either NTFS permissions or JVM security settings, I mean

20:50 itistoday: phew, ok done with my newlisp clj script, i haven't fully tested it, but it seems to work :-)

20:50 http://paste.pocoo.org/show/230451/

20:50 based on: http://github.com/russolsen/dejour/blob/master/bin/clj

20:51 mmarczyk: itistoday: heh, cool :-)

20:51 kiras: mmarcyzk: i don't know, but i wonder if it's related to something that's been bothering me, which is that sometimes with emacs open, i'm unable to empty the /lib directory

20:51 maybe i should try it with emacs closed, although i've been using eshell most of the time

20:51 mmarczyk: kiras: well, it would be useful to try doing it in a context where you can clean the directory by hand

20:52 kiras: mmarczyk: right. ok, i'll close emacs then

20:55 mmarczyk: even when i can clean the directory by hand, i get the error message from lein deps if the lib directory isn't already empty

20:56 mmarczyk: hm, not good

20:56 but this seems like a separate issue

20:56 so let's try fixing the uberjar thing for now

20:56 kiras: probably

20:56 ok

20:56 still making my way down the task list

20:56 mmarczyk: thanks :-)

20:57 kiras: heh np

20:59 mmarczyk: btw, you're just using the no argument versions of the tasks, right?

20:59 `lein jar`, `lein uberjar` etc.

20:59 kiras: mmarczyk: so far, yes

21:00 mmarczyk: ok, that should be enough

21:00 just wanted to make sure

21:00 kiras: ok

21:00 Raynes: itistoday: You really shouldn't put closing parens on their own lines. Lisp isn't C++. :P

21:01 itistoday: Raynes: I've been told that many times, but I just can't justify not doing it... yet at least. maybe if more people yell at me, but I hate the "standard way"

21:02 Raynes: to me, it's close to unreadable

21:02 Raynes: It just looks really ugly, and nobody who knows better does it. It feels okay for curly brackets, but parentheses don't serve the same purpose here.

21:02 But in the end, it's your code.

21:02 I'm just sayin'. :p

21:03 itistoday: Raynes: and *I'm just sayin'* that to me the standard way "looks really ugly" :-p

21:03 i don't know why people do it

21:03 Raynes: Because your unstandard way is unreadable to us. :p

21:04 itistoday: Raynes: i've tried to do it the standard way, and i couldn't take it, i had to go back

21:04 kiras: mmarczyk: ok, think i'm done

21:05 let me know if i missed anything... after this i'm thinking of making a feature subtraction request ;)

21:05 mmarczyk: kiras: :-)

21:05 itistoday: people complain about lisp's "many parenthesis" and "parenthesis zoo", I think it's mostly because people stack up their parenthesis and don't use them to delimit scope

21:05 Raynes: New people complain. After a while, they like it.

21:06 Or at least tolerate it with their editors.

21:06 But I don't think putting closing parens on new lines helps that.

21:06 itistoday: well I'm going to try to start a counter-movement :-D

21:06 because i think it does :-)

21:06 Raynes: Besides that, parens aren't just for delimiting scope.

21:06 itistoday: you'll thank me later ;-)

21:06 Raynes: Good luck with that.

21:20 mmarczyk: kiras: so, if I understand correctly, there are .jar files being created by lein jar & Co.

21:21 kiras: right? if so, could you open one of them up in an archive manager of some sort?

21:21 kiras: mmarczyk: yes, the jars are being built

21:21 mmarczyk: I'm wondering if they actually contain everything that they should

21:22 namely the .class files

21:22 kiras: mmarczyk: let me try extracting them

21:22 mmarczyk: ok

21:23 kiras: hm...

21:23 ok, so what .class files am i looking for?

21:24 mmarczyk: when i extract the non-standalone jar, i have a META-INF folder, a test_project folder and a project.clj folder at the root

21:24 mmarczyk: well, I guess the top level of the jar includes a test_project directory

21:24 yeah

21:25 and inside test_project ?

21:25 kiras: the standalone is the same with the addition of a clojure directory

21:25 core.clj

21:25 mmarczyk: just this file?

21:25 kiras: yeah

21:25 mmarczyk: ok

21:25 kiras: the classes must be in another castle

21:25 mmarczyk: one more experiment then:

21:26 apparently :-)

21:26 I'm not sure how one launches JVMs on Windows

21:26 so correct any obvious mistakes

21:26 kiras: well

21:26 mmarczyk: but I wonder about something like

21:26 kiras: i'm new to java

21:27 so i may not be able to correct you

21:27 mmarczyk: java.exe -cp "clojure.jar;clojure-contrib.jar" clojure.main

21:27 note the semicolon; I'm not sure this is the correct char, it ought to be the same one Windows uses for separating $PATH entries

21:27 Raynes: semi-colon is right

21:28 kiras: then it would be a semi colon

21:28 mmarczyk: ok then, this should be fine

21:28 kiras: and i remember using a similar command when i first started playing with clojure

21:28 clojurebot: clojurebot is like life: you make trade-offs

21:28 mmarczyk: clojurebot: um, I'll remember that, thanks

21:28 clojurebot: Pardon?

21:29 mmarczyk: ah, wait, I screwed up

21:29 I meant to include more stuff on the classpath

21:29 kiras: ok

21:29 mmarczyk: namely the src/ and classes/ directories under the project dir

21:30 with that addition, I'm curious about what happens when you evaluate (compile 'test-project.core)

21:31 kiras: mmarczyk: something like this: java -cp "clojure.jar;clojure-contrib.jar;src;classes" clojure.main in the project's root directory?

21:31 mmarczyk: kiras: right

21:32 kiras: how many lines can i paste here?

21:32 mmarczyk: not sure, but do you get an exception of some sort?

21:32 kiras: yes

21:32 mmarczyk: hah

21:32 involving the LispReader?

21:32 kiras: no

21:32 heh

21:32 mmarczyk: :-P

21:33 kiras: Exception in thread "main" java.lang.NoClassDefFoundError: clojure/main

21:33 Caused by: java.lang.ClassNotFoundException: clojure.main

21:33 mmarczyk: oh.

21:33 kiras: Caused by: java.lang.ClassNotFoundException: clojure.main

21:33 oops

21:33 more follows

21:33 mmarczyk: hmmm, try java.exe -classpath maybe

21:35 instead of -cp, I mean

21:35 kiras: same thing

21:35 mmarczyk: actually

21:35 I'd expect you to need to use lib/clojure.jar

21:35 kiras: which jar is it supposed to be using?

21:35 yeah

21:35 i was wondering hehe

21:36 windows terminal is so bad

21:39 mmarczyk: yup, one of the major annoyances

21:39 kiras: mmarczyk: java -cp "lib\clojure-1.2.0-master-2010623.220259-87.jar;lib\clojure-contrib-1.2.0-20100615.150419-128.jar;src;classes" clojure.main

21:39 no luck

21:40 mmarczyk: -cp -> -classpath

21:40 ?

21:40 kiras: oh, right

21:40 same result

21:40 mmarczyk: how about java -jar lib\clojure.jar ?

21:41 kiras: just that?

21:41 mmarczyk: yeah

21:41 kiras: i get a repl

21:41 mmarczyk: right, well then that error makes no sense :-/

21:41 kiras: hm

21:42 oh...

21:42 mmarczyk: ok, maybe try

21:42 kiras: i made a typo, i think

21:42 let me try again

21:42 mmarczyk: whew :-)

21:42 kiras: heh

21:42 ok

21:42 now it works

21:42 mmarczyk: :-)

21:42 so now, (compile 'test-project.core)

21:43 kiras: -cp and -classpath both work

21:43 ok

21:44 test-project.core is returned

21:44 mmarczyk: hm

21:44 any .class files in classes/ ?

21:44 kiras: let me see

21:45 yes

21:45 ls classes/test_project/

21:45 core$_main.class core$loading__4403__auto__.class core.class core__init.class

21:45 mmarczyk: huh. in this case, try a lein uberjar again

21:45 kiras: ok

21:46 same reader error

21:46 mmarczyk: right, but it might include those .class files in the jar, in which case it would be interesting to see whether java -jar can run it

21:46 kiras: no luck

21:47 mmarczyk: ahhhh, actually, that was nonsense

21:47 uberjar currently does a `lein clean` first

21:47 kiras: ah, right

21:47 mmarczyk: so hopefully classes/ is now empty :-)

21:47 kiras: heh

21:48 it is :)

21:49 so

21:49 if i do lein jar

21:49 after the compile from the repl

21:49 and lein jar doesn't do a clean

21:50 should i be able to run the program if i give the proper classpath to java?

21:50 and would that even do anything for us at all?

21:51 mmarczyk: I suppose it would be interesting to try

21:51 although

21:51 you'd have to run it as java -cp ...

21:51 kiras: right

21:51 mmarczyk: naming your :main class at the end

21:51 kiras: ah

21:52 like this: java -cp "lib\clojure-1.2.0-master-20100623.220259-87.jar;lib\clojure-contrib-1.2.0-20100615.150419-128.jar;src;classes" test-project.core ?

21:52 mmarczyk: yeah, I think java -jar doesn't take extra classpath args

21:52 kiras: `um, wait, not quite

21:52 kiras: ah

21:52 mmarczyk: test_project.core

21:53 also

21:53 kiras: we're back to that then, are we? :P

21:53 mmarczyk: skip src and classes

21:53 kiras: ok

21:53 mmarczyk: well, not really

21:53 the generated class must use _

21:53 though you should never need to care

21:53 kiras: ok

21:53 mmarczyk: except you need to name your files / folders appropriately

21:53 so it's not all that transparent

21:53 ah well

21:53 kiras: heh

21:55 mmarczyk: java -cp "lib\clojure-1.2.0-master-20100623.220259-87.jar;lib\clojure-contrib-1.2.0-20100615.150419-128.jar" test_project.core ?

21:55 mmarczyk: right

21:55 kiras: it didn't work

21:55 :(

21:56 mmarczyk: ah wait

21:56 your jar too

21:56 kiras: oh... in the classpath?

21:56 mmarczyk: yes

21:56 kiras: ok

21:56 mmarczyk: that's were your class should be

21:56 hopefully :-)

21:56 kiras: heh

21:58 mmarczyk: java -cp "lib\clojure-1.2.0-master-20100623.220259-87.jar;lib\clojure-contrib-1.2.0-20100615.150419-128.jar;test-project-1.0.0-SNAPSHOT-standalone.jar" test_project.core didn't work either

21:58 mmarczyk: wrong jar

21:58 kiras: ohhh

21:59 right

21:59 thanks

21:59 lol

21:59 mmarczyk: :-)

21:59 kiras: that works

21:59 mmarczyk: woohoo!

21:59 kiras: hehe

21:59 so, does that help us at all?

22:01 it seems like the problem is that the classes aren't being compiled, but this doesn't really help determine why that's the case, right?

22:01 itistoday: when I run M-x slime it says "it looks like Clojure is not installed, install now?" how can i tell it where my clj file is?

22:01 mmarczyk: kiras: well, it's good to know where to search for the problem

22:01 kiras: mmarczyk: true

22:10 mmarczyk: it seems like the reader error is happening when it hits either the d or the : in some path or another, right? is it possible that lein.bat is sending the wrong string somewhere?

22:11 mmarczyk: yeah

22:12 seems like lein.bat or leiningen.compile/eval-in-project issue

22:13 well, leiningen.compile... the exact function is just a guess

22:13 kiras: ah

22:14 so either it's bad input to a function in leiningen.compile from lein.bat or some function in leiningen.compile isn't handling valid input correctly?

22:14 mmarczyk: seems so to me

22:15 actually it would be possible to check this

22:15 sth like

22:15 kiras: i'm diffing the 1.1.0 bat against the 1.2.0 one

22:15 maybe something obvious will show up

22:16 mmarczyk: java -cp "clojure.jar;clojure-contrib.jar;leiningen.jar;src;classes" leiningen.core uberjar

22:16 with proper paths to the jars, of course

22:16 all this in the project directory, I mean

22:17 kiras: in the test-project directory or the leiningen project directory?

22:17 oh

22:17 nm

22:17 i could try that

22:17 mmarczyk: it should either work just fine or throw a tantrum like lein uberjar does

22:18 kiras: heh

22:18 mmarczyk: ...fully expecting to be surprised with a third outcome

22:19 kiras: lol

22:20 itistoday: could someone walk me through how to run ants.clj using lein?

22:20 mmarczyk: itistoday: ants.clj predates lein quite significantly

22:20 itistoday: mmarczyk: is not possible?

22:20 i mean, i'm sure it is

22:21 mmarczyk: itistoday: use your Clojure launcher script: clj ants.clj

22:21 itistoday: i copied the source into src/core.clj

22:21 mmarczyk: i'm trying to learn how to use lein

22:21 (and swank-clojure)

22:21 mmarczyk: Leiningen doesn't include a `lein run` task by default

22:22 if you just mean to run a repl from which you'll be able to call functions from ants.clj

22:22 lein repl should do that for you

22:22 or lein swank, for a SLIME repl

22:22 itistoday: it doesn't work

22:22 That's not a task. Use "lein help" to list all tasks

22:22 mmarczyk: what doesn't work?

22:23 itistoday: (for: lein swank)

22:23 and lein help doesn't show swank as a command

22:23 mmarczyk: ah, well, you'll need to include swank-clojure in :dev-dependencies for your project

22:23 itistoday: i thought it did:

22:24 mmarczyk: latest version is 1.3.0-SNAPSHOT, latest stable release -- 1.2.0, I think

22:24 itistoday: http://paste.pocoo.org/show/230481/

22:24 kiras: mmarczyk: does java -cp "lib\clojure-1.2.0-master-20100623.220259-87.jar;lib\clojure-contrib-1.2.0-20100615.150419-128.jar;d:/xPrograms/leiningen/1.2.0/leiningen-1.2.0-RC2-standalone.jar;src;classes" leiningen.core uberjar look ok?

22:24 mmarczyk: kiras: xPrograms ?

22:24 kiras: just a folder

22:25 itistoday: mmarczyk: http://paste.pocoo.org/show/230481/

22:25 mmarczyk: kiras: yeah, wanted to make sure the 'x' wasn't a typo

22:25 otherwise it seems fine

22:25 aaaahhhh

22:25 no

22:25 wait wait

22:25 kiras: heh

22:25 mmarczyk: if you're going to use -standalone.jar

22:25 kiras: i was wondering about that

22:25 mmarczyk: skip the clojure and contrib jars

22:25 kiras: ok

22:26 mmarczyk: itistoday: already looked at it

22:26 kiras: well, you wanted a third outcome ;)

22:26 mmarczyk: itistoday: I'm not sure if this will help, but

22:26 kiras: can't wait :-P

22:26 kiras: heh

22:26 mmarczyk: itistoday: you could try moving swank-clojure to :dev-dependencies

22:27 itistoday: I'm not sure if the regular dependencies are considered when lein looks for plugins

22:27 itistoday: still get this: "That's not a task. Use "lein help" to list all tasks."

22:28 mmarczyk: itistoday: what OS?

22:28 itistoday: 10.6.4

22:28 i'm cursing in my head

22:28 kiras: mmarczyk: http://gist.github.com/454565

22:29 itistoday: mmarczyk: i appreciate you trying to help me though

22:29 mmarczyk: itistoday: np, trying to come up with a guess as to what it's about

22:29 itistoday: i'm using the latest git stuff for lein

22:29 mmarczyk: kiras: ah, yeah, I got the class wrong

22:29 itistoday: i looked at the shell command (lein) and it really doesn't even have the word swank in it

22:29 wtf

22:30 kiras: i think moving swank-clojure to :dev-dependencies would work, if you haven't tried that yet

22:30 itistoday: kiras: i did try it

22:30 same result

22:30 kiras: i see

22:30 itistoday: unless i did it wrong: http://paste.pocoo.org/show/230482/

22:30 kiras: no, that looks right to me

22:31 mmarczyk: kiras: try java -cp "..." clojure.main -e "(use 'leiningen.core) (-main)"

22:31 kiras: did you do lein deps afterwards?

22:31 mmarczyk: ok, where "..." is the previous classpath?

22:31 mmarczyk: right

22:32 itistoday: 'lein deps' gives me a bunch of errors: http://paste.pocoo.org/show/230483/

22:33 mmarczyk: itistoday: ah, wrong version strings

22:33 use "1.2.0-master-SNAPSHOT" for Clojure

22:33 "1.2.0-SNAPSHOT" for contrib

22:34 itistoday: mmarczyk: you're my hero!! :-*

22:34 :-P

22:35 mmarczyk: :-)

22:35 itistoday: i had tried changing both to 1.2.0-SNAPSHOT, but that failed

22:35 i didn't think to try that...

22:35 (having one be 1.2.0-SNAPSHOT, the other for some reason different)

22:35 mmarczyk: that's a carefully installed trip-up device

22:37 itistoday: ok yay, so lein swank has launched a server

22:37 kiras: mmarczyk: java -cp "d:/xPrograms/leiningen/1.2.0/leiningen-1.2.0-RC2-standalone.jar;src;classes" clojure.main -e "(use 'leiningen.core) (-main)" brings up the lein help list

22:37 itistoday: now to try to connect to it

22:37 mmarczyk: kiras: add uberjar to the end

22:37 kiras: actually I'm wondering why the version using leiningen.core-the-class directly didn't work... I'll save that for later though

22:38 itistoday: slime-connect

22:38 itistoday: ok, getting an odd prompt: Versions differ: nil (slime) vs. 20100404 (swank). Continue? (y or n)

22:39 is that normal?

22:39 mmarczyk: itistoday: it is

22:39 kiras: mmarczyk: well... with uberjar it prints the help list again, then i get FileNotFoundException: uberjar

22:40 mmarczyk: do i need to pass a full path to the uberjar file as well?

22:40 mmarczyk: kiras: hm, didn't think so

22:40 kiras: java -cp "..." clojure.main -e "..." uberjar

22:40 kiras: right?

22:41 itistoday: holy crap... i have a window...

22:41 kiras: mmarczyk: java -cp "d:/xPrograms/leiningen/1.2.0/leiningen-1.2.0-RC2-standalone.jar;src;classes" clojure.main -e "(use 'leiningen.core) (-main)" uberjar

22:41 * itistoday holds breath

22:41 mmarczyk: kiras: right... hmm

22:42 itistoday: HOORAYYYY! ANTS AH-HOY!

22:42 look at the litter fuckers go

22:42 *little

22:42 got a little too excited there

22:42 mmarczyk: itistoday: happy for you ;-)

22:43 itistoday: mmarczyk: thanks for all your help!! http://cl.ly/baa49f2b89912ffa9a56

22:43 mmarczyk: well, it was the lein deps suggestion which provided the breakthrough :-)

22:43 itistoday: i'm surprised that after that everything went pretty smoothly

22:44 this ancient clojure file just worked

22:44 mmarczyk: kiras: I *really* don't get it, let me dive into lein.bat to see what's its bright idea for how to call into lein

22:44 kiras: mmarczyk: ok

22:44 mmarczyk: itistoday: no gratuitous breakage in Clojure-land :-)

22:44 one of the great parts of the experience

22:45 itistoday: so, one more question, what about auto-completion in emacs?

22:45 is slime needed for that?

22:46 mmarczyk: kiras: ok, so try "(use 'leiningen.core) (-main \"uberjar\")"

22:46 itistoday: depends on the kind of autocompletion you have in mind

22:46 M-/ will autocomplete as it usually does

22:46 itistoday: mmarczyk: the fancy-kind. :-) where it's based on knowledge of dependencies and function params, etc

22:47 mmarczyk: or if you use it for hippy-expand, it'll do the usual thing

22:47 well yeah, dynamic knowledge about the project is provided by swank

22:47 itistoday: mmarczyk: so i need to run 'lein swank' and then connect via slime-connect?

22:47 kiras: mmarczyk: yes, that works, but gives the same reader exception as just doing "lein uberjar"

22:48 so it looks like lein.bat may not be at fault?

22:48 mmarczyk: itistoday: I thought you just did that and it worked?

22:48 itistoday: mmarczyk: yeah i did, i mean in the future, and in general, for autocompletion

22:48 mmarczyk: kiras: agreed

22:49 itistoday: that's one good way of doing things

22:49 kiras: mmarczyk: also, classes is still empty, java -jar standalone.jar doesn't work, etc.... so it looks like it's exactly the same as lein uberjar

22:49 mmarczyk: itistoday: personally, I use M-x slime for standalone "experimental" repls

22:49 kiras: which seems kind of weird

22:50 itistoday: mmarczyk: i can't do that though, remember the error?

22:50 mmarczyk: itistoday: and a custom clojure-project function when working with a project

22:50 itistoday: mmarczyk: here, i'll get it again

22:50 mmarczyk: itistoday: well, I've got a totally custom slime setup

22:50 itistoday: mmarczyk: "It looks like Clojure is not installed. Install now?"

22:50 mmarczyk: itistoday: don't know much about the elpa setup

22:50 itistoday: mmarczyk: i'm trying to avoid that and just go by the books to avoid breaking anything

22:51 mmarczyk: kiras: right :-(

22:51 itistoday: the whole thing seems very fragile to me

22:51 mmarczyk: itistoday: oh? why would that be?

22:51 itistoday: underdocumented perhaps, if it doesn't come with a clear explanation of how to override various defaults

22:52 itistoday: mmarczyk: well, i've got so many clojures installed now

22:52 (jars)

22:52 mmarczyk: itistoday: which I wouldn't know anything about, because I haven't even got package.el installed

22:52 itistoday: i just want to have package.el take care of everything

22:52 and to not introduce conflicts by modifying it directly myself

22:52 kiras: mmarczyk: well, i think i need to take a break from this. any ideas on where i should go from here?

22:52 mmarczyk: itistoday: I meant a clearly documented way to tell elpa's slime / swank-clojure to "use this jar"

22:52 tomoj: so install clojure-mode and slime-repl from elpa, and you should be good

22:53 mmarczyk: kiras: yeah, well... actually I'm becoming extremely sleepy myself

22:53 kiras: mmarczyk: same hehe thanks for all your help

22:53 mmarczyk: kiras: I'll be looking into leiningen.compile, maybe I'll figure something out

22:53 tomoj: itistoday: you still have problems after installing those?

22:54 mmarczyk: kiras: np :-)

22:54 kiras: mmarczyk: ok, how will i know if you find a solution? should i just hang out here? lol

22:54 itistoday: tomoj: sorry, can you remind me what you're referring to? i was having problems, but mmarczyk helped me out to get ants.clj working with lein/swank/slime. now i'm trying to get M-x slime to use my existing clojure.jar

22:55 tomoj: oh

22:55 mmarczyk: kiras: I'd say make an issue on GitHub, with basic information about the problem -- maybe a link to your Gist (I think it misses info on lein jar, so maybe you could add it); indicate that it might be Windows specific (I can't reproduce it on Linux, plus there's the d: thing)

22:56 kiras: you could also provide a link to

22:56 tomoj: M-x slime will just use whatever is in ~/.swank-clojure

22:56 mmarczyk: kiras: http://clojure-log.n01se.net/

22:56 kiras: I mean to one of the date-and-time anchors within this conversation

22:57 if you want to be extra thorough :-P

22:57 but then again, maybe a mention that it's likely related to leiningen.compile would be better

22:57 kiras: ah, you mean just place a link in the gist?

22:58 thats kind of cool

22:58 that's

22:58 mmarczyk: kiras: a link in the issue text, to the gist

22:58 kiras: mmarczyk: i meant about the clojure-log site

22:58 but i think i follow you

22:59 i'll probably post the issue tomorrow, kind of tired right now

22:59 mmarczyk: kiras: ah, yeah; you'd need to use a .../date/2010-06-26.html link, though

22:59 kiras: ok

22:59 mmarczyk: kiras: sure; also, of course you should hang around here! :-)

23:00 kiras: mmarczyk: hehe ok, i'll be around

23:00 thanks again for all your help

23:00 mmarczyk: anyway. my `sleep` task is long overdue

23:00 kiras: heh

23:00 night

23:00 mmarczyk: will look into this again in my next waking period

23:01 kiras: ok

23:01 mmarczyk: good night :-)

23:01 kiras: night

23:05 itistoday: tomoj: thanks!

23:05 thanks to you I got M-x slime working too! :-D

23:06 i created symlinks in ~/.swank-clojure to point to clojure.jar and swank-clojure.jar

23:06 and that did the trick

23:07 tomoj: got paredit?

23:07 itistoday: tomoj: i do ... but i'm modified it a bit

23:07 it's no longer really paredit

23:07 i've sortof butchered it so that it behaves like TextMate

23:08 tomoj: I don't remember.. how does textmate behave?

23:08 itistoday: a lot more intuitively :-P

23:08 you type " and it creates "" and puts the cursor in between them

23:08 it does the same for { ( [, etc

23:09 tomoj: that sounds exactly like paredit

23:09 itistoday: well, not really

23:09 paredit is really funky

23:09 you can't, for example, delete them like normal

23:09 tomoj: oh, right

23:09 that's a good thing, though :P

23:09 itistoday: you have to press some crazy key combination

23:09 why is that a good thing?

23:10 tomoj: because manually balancing parens is a waste of time

23:10 itistoday: TextMate will delete both quotation marks if you press delete within an empty pair

23:10 tomoj: paredit does the same

23:10 itistoday: so you don't end up manually balancing very much

23:10 also, I frequently will wrap a function in a function

23:10 so I'll have some code like this: (((blah asdf ... etc

23:10 and i want to wrap that in another function

23:11 tomoj: but I just wanted to make sure you weren't going to go off clojure+slimeing without knowing about paredit, long as you do, cool

23:11 itistoday: in text mate, I just put an extra parenthesis in front of it

23:11 ober: would kill for repl on this portable :P

23:11 tomoj: it will add the closing paren automatically?

23:11 itistoday: tomoj: no, I C-e to the end and manually balance it

23:12 tomoj: right :)

23:12 itistoday: but in paredit, it puts this: () (((blah asdf ... etc

23:12 tomoj: in paredit you put point in front of the (((blah.. and hit M-(

23:12 itistoday: that's not very helpful at all

23:12 oh

23:12 tomoj: it is unintuitive, yeah

23:12 but imo very worth getting used to

23:12 itistoday: well i might have to give it a chance...

23:13 tomoj: if you ever do, be sure to get the beta, version 22

23:13 itistoday: tomoj: is that in elpa?

23:13 tomoj: nope :(

23:13 itistoday: why should i get the beta?

23:13 tomoj: it works better with clojure

23:13 clojure-mode will detect that you're using version 22 and fix {}

23:13 itistoday: tomoj: ok i'll give it a try

23:14 where can i get it from? is there a github repo?

23:14 tomoj: http://mumble.net/~campbell/emacs/paredit-beta.el

23:14 itistoday: yeah i just found that :-)

23:14 hmm...

23:15 they should put it on github or some site like that

23:15 so that you can just update it...

23:15 tomoj: then https://gist.github.com/038be3e78e8fa58d2733 works for me

23:16 itistoday: tomoj: thanks!

23:17 what do you do in the slime repl?

23:17 tomoj: http://mumble.net/~campbell/emacs/paredit-beta.html

23:17 I don't use paredit in the repl

23:17 itistoday: well, i mean in general

23:17 tomoj: I think it causes some problems, but there is some way to resolve the problems, but I just haven't bothered yet

23:18 itistoday: i just tried running some source code in it from the ants.clj file: (dorun (map #(send-off % behave) ants))

23:18 and it gave me an exception, despite the file being loaded

23:18 so... i'm not sure what it's for

23:18 tomoj: what was the exception?

23:19 probably it still says "user>" ?

23:19 itistoday: http://gist.github.com/454599

23:19 tomoj: yes

23:19 tomoj: oh, well, that's fine because ants.clj doesn't declare a namespace, hmm

23:19 itistoday: well, actually, it does

23:19 i modified it to do that

23:19 so that it would work with the lein project

23:20 how do i switch to ants.core?

23:20 tomoj: oh, then you need to switch into that namespace

23:20 type ",i" at the repl

23:20 then you can type a package name (with tab-completion)

23:20 itistoday: oh, cool

23:20 yay!

23:20 that works :-)

23:20 ok, now i see that it does indeed do what i expected it to

23:21 tomoj: that's always nice

23:21 itistoday: is there a way to get a list of the defined functions in a clj file? perhaps have it in speedbar?

23:22 so that i can quickly jump to a function by clicking on it

23:22 tomoj: not sure if something is there already for that

23:22 should be possible with some elisp though

23:23 you can already jump to a function definition by hitting M-., but that's a bit different

23:24 (e.g. type "map" in the repl and hit M-. :D)

23:24 still amazes me that it reaches into jars

23:24 itistoday: thanks for that tip! yeah i just noticed that too, and it has autocompletion

23:27 do you happen to know in advance whether i need to rename paredit-beta.el to paredit.el?

23:27 tomoj: (err.. forgot to include your name)

23:27 tomoj: I did, not sure if it's necessary

23:27 probably a good idea

23:27 itistoday: mmk

23:35 yup, turned out to be necessary :-p

23:47 tomoj: i don't like how paredit changes the behavior of the backspace key

23:47 anyway to make it not do that?

23:47 now whenever i highlight something and press backspace, it doesn't delete it

23:48 tomoj: dunno, sorry

23:48 I'd use C-w

23:48 but be careful with that, it can unbalance your parens

23:48 itistoday: tomoj: i don't think that's dangerous at all

23:49 i'm used to normal text editors not adding parenthesis like paredit does

23:49 and most of them have paren-highlighting

23:50 tomoj: better (imo) to use delete commands that know about sexps

23:50 itistoday: i disagree, but to each his own

23:50 tomoj: except for a whole bunch of toplevel forms or something

23:50 itistoday: how the heck do you delete a parenthesis?

23:50 tomoj: if you must, C-u DEL

23:51 itistoday: ok, thanks, yeah, i'm going to edit this thing so that it always does that

23:51 tomoj: the idea with paredit is that you should never have to

23:51 itistoday: tomoj: well, i just ran across a scenario where i needed in the first minute of using it

23:51 *needed it

23:52 i'm not going to force my brain to adapt to this thing also because i don't want to become dependent on it

23:52 no other editor behaves this way

23:52 polypus: itistoday: i think i've used C-u DEL once in aabout a week of heavy coding so it's rarely needed.

23:52 tomoj: never considered that

23:52 Raynes: If you aren't going to learn to use paredit properly and use it's commands, why bother with it?

23:52 tomoj: it's rarely needed IF you do things the paredit way

23:52 itistoday: polypus: like i said, i just needed in the first minute of using it

23:52 tomoj: if you go around C-w'ing or things like that, sure, you'll need it

23:53 polypus: just cuz you're not used to it that's all

23:53 itistoday: polypus: i don't think so, i copy/pasted some text, and it added an extra paren

23:53 i needed to get rid of it

23:53 happens all the time

23:53 tomoj: you're right, though, I don't think I could stand using another editor for clojure

23:53 but that's fine with me :)

23:54 itistoday: Raynes: i want it for its creation of matching pairs

23:54 polypus: itistoday: it shouldn't happen all the time. you must not be copy pasting corectly

23:54 itistoday: Raynes: that's it though

23:54 polypus: uh huh...

23:54 polypus: whatever you say

23:54 polypus: ok

23:55 tomoj: itistoday: maybe autopair.el or something like it is more suitable for you

23:55 itistoday: tomoj: thanks!!!

23:55 autopair

23:55 Automagically pair braces and quotes like TextMate

23:55 someone understands me :-D

23:56 tomoj: paredit needs testimonials

23:57 polypus: tomoj: yeah seriously. after a few days of using it there just isn't any going back

23:57 itistoday: that's what scares me

23:58 i like being comfortable with Xcode, TextMate, and millions of other editors

23:58 polypus: itistoday, don't be scared it's very powerful, and emacs isn't going anywhere

23:58 itistoday: polypus: one step at a time, i just finished setting up clojure today

23:58 maybe you lunatics will convince me in the end, but not today

23:58 tomoj: :)

23:58 polypus: ;)

23:59 itistoday: :-p

Logging service provided by n01se.net