#clojure log - Mar 13 2010

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

0:00 psykotic: remleduff: you have to write some code

0:00 somnium: remleduff: `M-x customize-group auto-complete` and add clojure-mode, slime-repl-mode etc to modes

0:01 psykotic: somnium: won't he need to write a function for calling auto-complete with the completed symbols, etc?

0:01 somnium: well, the stuff at the top of the .el you can just copy-paste iirc

0:02 psykotic: oh, for slime integration? that would take some tweaking

0:03 psykotic: i dug through slime.el a bit, and he could try calling slime-simple-completions for a start

0:03 somnium: just leaving a clojure.core buffer open seems to do a fair bit of work

0:03 psykotic: that should just return a list of symbol directly, without any window/buffer ceatiocreation, etc

0:03 remleduff: Actually, it seems to work out of the box in a clojure-mode buffer

0:03 Just not in the repl

0:04 psykotic: really?

0:04 oh, because it does dexpand-style buffer sniffing?

0:04 dabbrev even

0:04 remleduff: No idea what that means

0:04 psykotic: dabbrev looks at all open buffers as a source for completions

0:05 i guess it uses it as a default source

0:05 remleduff: I don't have any buffers open that have "some" in them

0:05 psykotic: dunno in that case

0:06 remleduff: But if I do "(so" and wait, it prompts me with a list of symbols that start with so including some

0:12 psykotic: i like the typical way autocompletion of the top candidate tends to work in url location bars in web browsers

0:13 ie you start typing, it suggests the top completin 'inline', and if you press enter at that point, it just accepts the completion

0:14 99% of the time when i'm using autocompletion to save typing, i already know what the top candidate will be, so telling me about the other potential candidates is obnoxious

0:21 remleduff: I think autocomplete works in browser because it's just coming from your history, there are a lot more symbols in "all of clojure" that could match

0:22 If I do, "M-." to jump to a definition using swank-clojure, why can't I "M-*" to jump back to where I was?

0:22 Crap, I can

0:22 I was doing C-*

0:24 technomancy: I always use M-, for that

0:25 remleduff: Ah, that's much better, thank you

0:33 kwertii: is there any way to get line numbers in stack traces with SLIME? I've tried loading my file with C-C C-L, C-C C-k, and individual functions with C-M-x, and I still only ever get (NO_SOURCE_FILE:1) on any of my code...

0:34 technomancy: kwertii: someone mentioned having that problem a few days ago

0:35 but they didn't report a bug or anything, so I don't have a way of following up on it. =\

0:35 kwertii: technomancy: do most people get real line numbers when they do this? :)

0:35 technomancy: kwertii: you should for C-c C-k. the other methods don't provide line numbering info right now.

0:36 tomoj: what's C-c C-k bound to?

0:36 kwertii: technomancy: would it matter if I had already loaded the file with C-C C-L before doing the C-k?

0:36 technomancy: slime-compile-and-load-file

0:36 kwertii: no, it shouldn't make a difference

0:36 tomoj: hmm

0:36 technomancy: tomoj: slime inherits a load/compile distinction from CL that doesn't make sense in clojure

0:38 kwertii: technomancy: ah. it works. thanks :)

0:39 tomoj: strange

0:41 kwertii: tomoj: as I understand it (and anyone please correct me if this is wrong), CL can keep the code in memory as an s-exp tree to be interpreted when run, and also compile to machine language, whereas clojure always compiles to JVM bytecode

0:43 technomancy: are there any plans (or is it even possible to) get the full SLIME debugger stuff working with Clojure?

0:43 tomoj: I saw some stuff on the swank-clojure mailing list recently about it, I think

0:43 technomancy: kwertii: hugod is working on some cool debugger repl stuff, but it's not the CL-style debugger

0:43 still pretty awesome though

0:44 kwertii: technomancy: cool, anything would be great

0:45 tomoj: what is "hyperdoc"?

0:46 oh, I see

0:59 psykotic: technomancy: is there any existing java-on-emacs debugging infrastructure to reuse?

1:01 remleduff: Is there a "send current file to repl key?

1:01 "

1:02 kwertii: remleduff: C-C C-k (current buffer), C-C C-L (some file, current one by default)

1:03 remleduff: Thanks

1:03 kwertii: I have some data being gathered in parallel by a pool of worker threads. I need to aggregate it. Is it better/worse/the same to pass a ref to each worker and have the worker add the data to the ref, or to have the thread return the data as its return value and make the calling function aggregate all the threads' results?

1:03 remleduff: sure np

1:05 psykotic: emacs has extensive debugging mode stuff built in, and I seem to recall from my Java days that there is a Java interface for it...

1:05 psykotic: if you mean the GUD, ugh

1:07 anyway, i was more referring to java-specific backend stuff. the GUD is mostly frontend.

1:08 hiredman: kwertii: pmap/pvalues + reduce

1:12 kwertii: hiredman: interesting, I'll give that a try, thanks

1:26 hiredman: not sure that I can make that work.. I'm using Apache HttpClient with the threads, which has its own ideas of how threading should work

1:27 but will try

2:04 technomancy: psykotic: http://georgejahad.com/clojure/cljdb.html

2:05 psykotic: technomancy: nice, thanks

2:05 technomancy: might be a little outdated

2:32 zab: Hi. I am trying to understand loop/recur. Can someone tell me why this does not work the way I expect it to? http://paste.lisp.org/display/96317

2:33 hiredman: is that SuperCVS?

2:33 zab: opencsv: http://opencsv.sourceforge.net/

2:33 * hiredman makes a note

2:34 hiredman: what are you expecting it to do?

2:34 zab: print out each line in a CSV file

2:34 in Java, opencsv is typically used like this: while ((nextLine = reader.readNext()) != null) {...

2:34 hiredman: fyi nil is boolean false in clojure, and when you evaluate to nil on false it is ideomatic to use when

2:35 (when line ...)

2:35 and what does it do?

2:35 zab: returns a String[], until the while loop is exhausted

2:36 i.e. there are no more lines in the CSV file to parse

2:36 hiredman: no

2:36 I mean what does your clojure code do when you run it?

2:36 zab: no output

2:37 hiredman: are you sure there should be some?

2:37 zab: yeah, I have checked and my file is being uploaded, and a new CSVReader is being correctly instantiated.

2:37 with the uploaded file

2:37 hiredman: I would start adding logging/prns to trace the program

2:38 (doto (.readNext csv-reader) prn)

2:38 will prn the result of .readNext and also return it

2:40 G0SUB: I have a news, Clojurians....

2:40 hoeck: zab: and split the function in a request-processing and a csv-processing one and a printing one, so can better test them

2:40 G0SUB: [ANN] There is going to be a Clojure Cookbook.

2:40 I will put up an website with the info soon.

2:41 hoeck: G0SUB: nice!

2:41 tomoj: for chef?

2:41 or, like "rails recipes" ?

2:41 G0SUB: We will invite recipes from the community. (Recipe authors will get credit in the book)

2:41 zab: hiredman, hoeck: okay :)

2:41 tomoj: awesome

2:41 G0SUB: tomoj, on the lines of Perl Cookbook. but not by O'Reilly.

2:41 hiredman: the loop there looks ok

2:42 so start printing to check and see the data flowing through is what you expect

2:42 hoeck: G0SUB: short things like (->> (CSVReader. <args>) (iterate #(.readNext %)) (take-while identity) doall) ?

2:42 G0SUB: or more complete/bigger solutions?

2:42 G0SUB: hoeck, those, and some more involved things too.

2:42 hoeck, recipes encompassing all levels.

2:43 hoeck, covering the most common things that people would want to achieve with Clojure.

2:43 hoeck: G0SUB: I'd like to see/write sth. on macro-writing macros!

2:44 G0SUB: hoeck, sure. I will announce the website and other details when the contract has been signed. give me a week or two.

2:44 zab: hiredman: http://paste.lisp.org/display/96318 prints #<String[] [Ljava.lang.String;@3bfe8b7c>

2:45 hiredman: So I am fairly sure the only thing wrong with my code is my loop/recur.

2:45 hiredman: zab: don't change the code!

2:45 just add print statements

2:45 like (loop [ … ] (prn line) … )

2:46 zab: hiredman: k

2:49 the condition (if (= line nil) is always satisfied

2:50 hiredman: so .readNext always returns nil?

2:51 zab: Seems like it. But I don't have confidence in the way I've defined the loop. First one I've written. ;)

2:52 hiredman: well it looks sound

2:52 the problem appears to be with your vsc file

2:52 csv

2:52 or, not the file, but before you enter the loop

2:53 (doto (:tempfile (:form-csv-upload (:multipart-params request))) prn)

2:54 actually

2:54 (doto (:tempfile (:form-csv-upload (:multipart-params request))) (-> .exists prn))

2:55 zab: both gave me the same output, complete dump of the CSV file

2:55 hiredman: what do you mean both?

2:55 zab: the 2 lines you provided

2:55 hiredman: and you whould not see the output of those lines, just what they print

2:56 and the second like will just print true/false

2:56 unless you aren't actually putting them into the fn

2:56 which means you are not really debugging the fn

2:58 zab: this: http://paste.lisp.org/display/96319 dumps the CSV file

3:00 hiredman: http://paste.lisp.org/display/96317#1

3:00 23:46 hiredman : zab: don't change the code!

3:01 that will dump the file, and it is not what I asked you to do, do you want help or not?

3:02 zab: i didn't understand what you meant

3:05 hiredman: the parens are not balanced correctly in the annotation I made

3:05 sorry

3:05 zab: Yeah that's okay. I'm trying to fix it up. V new to Clojure.

3:08 I get no output. Expected?

3:10 hiredman: no

3:12 http://paste.lisp.org/display/96317#2 try this

3:13 is should print out :enter, a boolean, some kind of map, and then maybe :loop

3:14 zab: no output

3:14 hiredman: how are you running this? obviously through compojure somehow, but how are you starting compojure

3:14 zab: through nailgun/vimclojure

3:15 hiredman: zab: so whatever you are doing that you thing you are changing the definition of this function is not actually changing it

3:15 s/thing/think/

3:15 well

3:16 possibly it's an issue with *out* though

3:16 how are you starting nailgun?

3:17 zab: through an ant script. works well.

3:17 hiredman: ant may be eating prints

3:18 * hiredman hasn't used ant in sometime

3:18 hiredman: what happens if you just eval (.println System/out "test")

3:19 do you see anything in the terminal where you ran/are running ant

3:19 or even in vimclojure's repl buffer

3:20 zab: nothing from terminal where ant is running. vimclojure's repl buffer returns output: test and nil

3:20 hiredman: well that's good, I guess

3:20 how are you re-defing the function?

3:21 zab: recompiling in vimclojure with \ef, and then refreshing my browser to see new output

3:21 hiredman: hmmm

3:22 can you restart everything easily?

3:23 zab: yep.

3:23 hiredman: or I should say, restart compojure

3:23 zab: yep I just did. I just restarted my whole environment.

3:23 hiredman: ok, and?

3:23 zab: same :(

3:23 hiredman: where are you calling this function from?

3:24 oh!

3:24 are you calling this directly from the defroutes form?

3:24 zab: I've defined routes via compojure's defroutes

3:24 heh yes

3:24 hiredman: bah

3:24 nevermind

3:25 well, put a (do (println :foo) process-uploaded-csv

3:25 )

3:25 in place of process-uploaded-csv

3:25 make sure that route is getting called

3:27 zab: no output from: http://paste.lisp.org/+22BH/3

3:27 hiredman: can you post the build.xml?

3:28 tomoj: what's the response?

3:28 zab: tomoj: blank

3:28 hiredman: that is odd

3:29 do you have a trailing '/' in the url in your browser?

3:29 well no, that should get an exception, not blank

3:29 zab: no. I didn't mention I am also going through this proxy servlet: http://www.hackers-with-attitude.com/2009/08/intertactive-programming-with-clojure.html

3:29 for app engine

3:30 hiredman: ah

3:30 that might be why the prn stuff is not working

3:30 zab: apologies

3:30 hiredman: I forget if the local devserver pass that or not

3:32 (defmacro log [string] `(.info (Logger/getLogger "global") ~string))

3:32 put that right after your (ns …)

3:33 well, put a (do (log "foo") process-uploaded-csv

3:33 )

3:33 uh, edit and change the (println :foo) to (log "foo")

3:36 zab: where is this log output supposed to go?

3:37 hiredman: stdout or stderr

3:37 either the repl buffer or the terminal with ant

3:38 do you have all those pesky appengine xml files setup?

3:38 zab: yep

3:39 hiredman: and a basic helloworld page works?

3:39 zab: yep

3:39 hiredman: are you sure?

3:39 oh

3:39 hell

3:39 I was thinking about this earlier

3:39 btw the multipart stuff compojure uses is not allowed on appengine

3:39 zab: yeah. I've got an enlive page that is a html form, which is what I use to POST the CSV file.

3:40 the enlive page is served correctly and it uploads the file fine

3:40 hiredman: you won't be able to upload anything that uses the multipart stuff to appengine

3:41 zab: I changed apache commons-fileupload package to make it work on GAE.

3:42 the only reason it doesn't work on GAE is because it references java.rmi.server.UID. I just changed file-upload to use java.util.UUID instead.

3:43 hiredman: ok

3:43 zab: also, I don't think vimclojure shows output in its repl.

3:43 hiredman: are you recompiling before restarting the dev server?

3:43 zab: well it doesn't show output from the jetty server it runs anyway

3:43 yeah

3:44 hiredman: what happens if you just put (println :foo) in the middle of the file?

3:44 zab: and I think you're right in that ant is eating stdout/stderr

3:45 hiredman: gah

3:45 it might not eat stderr

3:46 zab: (println :foo) nothing happens.

3:46 hiredman: (.println System/err "foo") somewhere in your file

3:47 or (binding [*out* *err*] (println "foo"))

3:47 zab: nothing. I think it is ant.

3:47 i will investigate

3:47 hiredman: the sdk comes with a shell script for starting the server

4:42 zab: hiredman: thanks for your help. I'm logging off for now. It's GAE who is eating the stderr/stdout output.

6:04 dcnstrct: (.length (byte-array 2)) <-- why doesn't that work ?

6:05 ahh ok.. (alength (byte-array 2)) works

6:05 shouldn't both of those work though in theory ?

6:37 raek: dcnstrct: I think (but I could be wrong) that .length is special java syntax for arrays

6:37 and that the bytecode for a .length method call for an ordinary object is not the same as the .length for arrays

6:46 dcnstrct: oh that's right... I forgot in Java everything is not an object

6:46 there are all these special cases like that

6:46 or rather.. some things are not objects..

6:46 heh

6:50 LauJensen: I'm sitting here trying to recall my first impressions when looking at Common Lisp - It was a little scary and required quite a bit of concentration, but when looking back I have a hard time working out why I had any difficulty with is - Anybody else had such thoughts RE the learning curve ?

6:52 (not CL specific, same goes for new-comers to Clojure)

6:52 Raynes: Lisp wasn't more complicated than anything else to me.

6:53 It was OOP that took me a while to wrap my mind around.

6:53 LauJensen: Thats almost the complete opposite of everyone else I think

6:54 Raynes: Mostly because almost everything I've ever read about it was so abstract that I don't really see how I ever understood it in the first place.

6:54 "This is sending a message to that on this for that."

6:54 wut

6:55 First, you have to understand the point of it. For a long time I sat around, all like "What is the point of this...". Once I grasped that, it was level ground from there.

6:55 LauJensen: I think maybe your practical nature has served you well in this regard. Most of us struggle with general principles for a while, especially RE functional programming, but I think you have larned so quickly by asking the fundamental question first "How can this fix the radio in my pick-up truck?" :D

6:55 Raynes: Holy hell, it's daylight.

6:56 Uh oh.

6:56 Daylight savings time.

6:56 LauJensen: But comfortably reading Lisp was as easy for you as C et al ?

6:57 Raynes: I've never really used curly bracket languages.

6:57 /discussion

6:58 LauJensen: aha

6:58 That might atually explain the ease of entruy

6:59 Disregarding the 'u'

6:59 Raynes: I've played with Scala, but the whole "You have to explicitly mention the types of arguments." stuff irked me.

6:59 LauJensen: Scala has very good type inference

7:00 Raynes: Indeed, but having to explicitly type argument types makes my eyes bleed.

7:00 And my fingers shiver.

7:01 LauJensen: But I don't think you HAVE to

7:04 dcnstrct: languages like Ruby are really helping to bridge the gap from curley braced world.. once you go from c/java to ruby and you wrap your head around meta-programming, DSLs, closures, etc then it's a lot easier to see why lisp is so cool.

7:04 Raynes: LauJensen: What was the last message you got from me?

7:05 SynrG: 08:00 < Raynes> And my fingers shiver.

7:05 Raynes: Thanks.

7:06 dcnstrct: Ruby is a trojan horse to get lisp inside the curley bracket programmer's head.

7:06 Raynes: http://gist.github.com/331289

7:06 LauJensen: I dont understand why people claim that Ruby has the full Lisp chainsaw - Where's the connection ?

7:06 Raynes: I'm with Mister Jensen.

7:07 dcnstrct: well with Ruby you can add extensions to the language easily.. to create DSLs are almost macros

7:07 Raynes: "almost"

7:07 dcnstrct: ok not easily.. and not extensions to the lnaguage... but stuff that kind of feels like it

7:07 noidi: I don't get it either... it's quite a jump from a language.like.api() to macros

7:07 LauJensen: How so ? Its not homoiconic, it doesnt control evaluation, wheres the connection ?

7:07 Most of these 'macros' look like nothing more than regex tricks

7:08 ( I might be wrong, I'm not a Rubist, so these are honest questions )

7:08 eevar: Raynes, Scala does type inference, though? so you don't have to add type declarations?

7:08 Raynes: eevar: You have to explicitly declare the types of function arguments.

7:09 LauJensen: Raynes: Im not sure thats the case anymore

7:09 Raynes: It certainly was like 6 months ago.

7:09 eevar: okies. I decided going for haskell was more worthwhile than learning scala

7:09 so don't have any scala experience at all

7:09 dcnstrct: you can add methods to your objects at runtime in Ruby that can give you marco like functionality

7:10 Raynes: Haskell is probably more worth learning than most any other language.

7:10 If anything can teach you how to program functionally, and smack you around if you fail, Haskell is it.

7:10 LauJensen: dcnstrct: I think thats a stretch- A _huge_ stretch

7:10 Anyway - back to the thinking box

7:11 G0SUB: LauJensen, it's mostly some specific syntactic sugar to assist in metaprogramming.

7:11 LauJensen: G0SUB: Where on the other hand, Macros _are_ metaprogramming you mean ?

7:12 dcnstrct: macros are just a good way to do metaprogramming... Ruby has a poor way to do meta-programming, but it's better than most of the curley languages that have no way to do meta-programming.

7:12 G0SUB: LauJensen, according to Ruby guys, macros are not the only way to do metaprogramming

7:12 dcnstrct, +1

7:12 LauJensen: dcnstrct: Curly braces are catching up- There's a lot of talk of metaprogramming in C# I think

7:12 G0SUB: LauJensen, make no mistake, Ruby has very limited MP support.

7:13 dcnstrct: yeah they're all trying to catch up.. java has annotations now to try to get some of the same..

7:13 Ruby has the best meta-programming support of any curley bracket language I think

7:13 but it's still piss poor compared to a lisp

7:13 LauJensen: Ok - So still no idea where this "full lisp chainsaw" talk is from ?

7:14 Raynes: "full lisp chainsaw, without the chain and fuel"

7:15 LauJensen: hehe

7:15 G0SUB: Raynes, and the saw

7:15 LauJensen: HAHA

7:15 Raynes: ;)

7:15 G0SUB: that'd be more appropriate

7:15 LauJensen, http://ruby-metaprogramming.rubylearning.com/

7:15 dcnstrct: http://www.randomhacks.net/articles/2005/12/03/why-ruby-is-an-acceptable-lisp

7:16 Raynes: I signed up for the rubylearning Clojure course.

7:16 dcnstrct: lol @ lisp chainsaw

7:16 G0SUB: Raynes, cool. I hope the course proves to be useful

7:16 LauJensen, http://ruby-metaprogramming.rubylearning.com/

7:17 dcnstrct: class Order < ActiveRecord::Base belongs_to :customer has_many :items, :dependent => true

7:17 Raynes: I hope I can prove to be useful.

7:17 I mainly signed up to help others.

7:17 dcnstrct: oops didn't mean to passe that last part

7:17 LauJensen: dcnstrct: That article makes a lot of sense considering its from 2005

7:18 "Lisp hasn't gone anywhere in 20 years and has no libraries" - If only he would have waited 1 year :)

7:18 dcnstrct: hahaha

7:18 G0SUB: Raynes, FYI, I am a teacher of the course :)

7:19 Raynes: G0SUB: Oh, cool.

7:19 G0SUB: Raynes, you can help us in creating excercises.

7:19 Raynes: I'm a teacher as well. I'm just undercover as a student. s_s

7:19 :p

7:19 G0SUB: Raynes, I will let you know...

7:20 Raynes: Which teacher are you?

7:20 G0SUB: Raynes, Baishampayan Ghose

7:20 Raynes: That's a mouth full.

7:20 G0SUB: yes

7:21 Raynes, call me BG or G0SUB :)

7:21 Raynes: :)

7:21 Are the lessons going to be screencasts or something?

7:22 G0SUB: Raynes, not at this stage...

7:22 Raynes: Good.

7:22 I don't have the bandwidth for screencasts.

7:23 LauJensen: G0SUB: Oh youre Baishampayan Ghose - Is there a special story behind that name ?

7:23 G0SUB: LauJensen, it's an Indian name.

7:23 Raynes: I keep wanting to pronounce his last name as goose.

7:23 LauJensen: Hehe

7:23 G0SUB: LauJensen, Ghose is a common surname.

7:23 LauJensen: I read it as "Bayesian Goose" as well

7:23 Ah ok - Just wondering, hope you dont mind me asking, but India is a long way from Denmar

7:23 k

7:23 G0SUB: LauJensen, some people have called me Bon Goose.

7:24 LauJensen, indeed, it is. it's near China

7:24 LauJensen: If I were you, I might consider changing name to "Rich Hickey", that could give you a lot of business in India ;)

7:25 G0SUB: LauJensen, I would doubt that. not many people know about Clojure in India. and anyway, I am not qualified enough to be called Rich Hickey.

7:25 Raynes: You aren't qualified to be called a Goose either, but...

7:25 G0SUB: Raynes, indeed.

7:26 I can't fly/

7:26 Raynes: G0SUB: I'm Anthony Simpson on rubylearning, in case you were wondering.

7:26 LauJensen: I saw a sign from India the other day, "Michaels Soft Twindows" or something like that - only reason I mentioned it

7:26 Raynes: I'm not related to Homer, Jessica, et al.

7:26 G0SUB: Raynes, I see. :)

7:26 LauJensen, where did you see it?

7:27 SynrG: ah, i'm enrolled in the course, too

7:28 LauJensen: Dont remember

7:29 SynrG: Ben Armstrong. the guy who wants to run clojure on OpenVMS.

7:29 incidentally, what sorts of issues might I expect using java5?

7:29 unfortunately, HP only makes java6 for VMS/Itanium and our primary dev system (and all of our clients) is VMS/Alpha

7:30 for which there is only java5

7:30 danishkirel: test

7:30 Raynes: LauJensen: Didn't you say you were playing with J or something?

7:30 LauJensen: I <3 J

7:30 Raynes: It looks awesome.

7:30 hiredman: SynrG: clojure runs on 5 fine

7:30 LauJensen: It is

7:31 Raynes: Useful for anything?

7:31 LauJensen: (if only they would add the option for inifinite seqs)

7:31 SynrG: hiredman: my initial tests said so, anyway. but i haven't done anything real with the language

7:31 LauJensen: Raynes: If you read my "Putting my Clojure hat back on" post, I think thats where it finds it greatest usages, in simplifying the way you think about data. The secondly, it great for rapid visualising of data

7:31 SynrG: i was even playing with nailgun on VMS and that seemed to work

7:32 LauJensen: Writing 'real' software in J would probably be incredible painful

7:32 hiredman: that being said I've seen one or two reports of speed ups from moving to java6

7:32 etate: some1 would like to try my uber color-theme?

7:32 dcnstrct: I would

7:32 emacs ?

7:32 etate: ye

7:32 Raynes: I'll try it.

7:32 dcnstrct: hook it up I was just getting tired of mine

7:33 etate: http://gist.github.com/331058

7:33 Raynes: LauJensen: Haha @ Dong Energy

7:33 LauJensen: Hehe

7:33 Raynes: Its a _huge_ company, I dunno why they picked that name

7:33 etate: screenshot?

7:34 etate: LauJensen oka, where is an easy paste for screens?

7:34 Raynes: etate: tinypic

7:34 LauJensen: etate: nvm, I just ran the code - I was being too lazy

7:34 It looks good

7:35 I think I'll stick with charcoal-black, but its better than the majority of the themes out there :)

7:35 dcnstrct: Symbol's function definition is void: color-theme-install

7:35 weird

7:36 LauJensen: dcnstrct: just paste the code in ielm

7:36 Raynes: etate: Looks good. I like dark themes though. I use hober.

7:36 etate: LauJensen: thanks, my first attempt :)

7:37 dcnstrct: yeah I did.. then did M-x eval-buffer

7:37 LauJensen: nice

7:37 dcnstrct: oh well

7:37 Raynes: LauJensen: Charcoal black sucks.

7:37 :p

7:37 etate: Raynes: my theme is not dark? :)

7:37 Raynes: you mean the colours are bright in the text?

7:38 Raynes: etate: I mean dark as in black.

7:38 Or close to black.

7:38 etate: Raynes: ah, actually this theme started closer to black, i will show you the original sec

7:38 Raynes: I think I'm going to switch to vibrant-ink for a while, see how my eyes work out with it.

7:39 noidi: http://brockman.se/2003/zenburn/zenburn.el http://slinky.imukuppi.org/zenburn/zenburn.png

7:39 :)

7:39 etate: Raynes: http://gist.github.com/331299

7:40 noidi: nice theme :)

7:41 Raynes: Cute.

7:42 It's easy on the eyes.

7:46 raek: is it a bad practice to let namespace foo.bar use foo?

7:47 or should dependencies only be "downwards" in the ns hierarchy?

7:47 noidi: I'd put the stuff that the sub-namespaces use into foo.util or something

7:48 hiredman: and you shouldn't have a foo

7:48 Raynes: I'm disoriented.

7:48 I'm not sure what time it is.

7:49 hiredman: single segment namespaces can raise issues with compilation

7:49 noidi: Raynes, 14:49 ;)

7:50 raek: yes, I just was too lazy to make up more parts of the namespace

7:50 s/foo/x.y.foo/

7:50 anyway, I want to define a multimethod in x.y.foo

7:51 and separate the different implementations into different files

7:51 hiredman: I don't see why not, just watch out for circular dependencies

7:52 raek: ok, thanks!

7:52 noidi: in that case I think referring "upwards" is fine

8:02 * Raynes wishes he knew how to implement the Mersenne Twister.

8:03 pdk: it involves a hula hoop and absinthe

8:03 Raynes: Ioke needs good random numbers.

8:04 LauJensen: Quick, while nobodys talking Clojure, this video http://flattr.com/beta/ <-- Which type of software makes making one of those easy ?

8:05 noidi: I'm currently reading On Lisp, and I'm amazed at how much nicer Clojure is than Common Lisp

8:06 not only am I learning Lisp, I'm also learning to appreciate all the nice things in Clojure that I took for granted before :)

8:07 esj: Lau : that's an interesting idea

8:07 noidi: especially how Clojure deals with variable capture and gensyms in macros

8:09 LauJensen: I think I'm going back to ERC now

8:09 Raynes: I can't force myself to configure ERC.

8:10 LauJensen: Well I'm past that

8:10 If only I could implement Thunderbird in Emacs, I'd never have to leave

8:10 etate: Raynes: i've just created a new theme based on a darker palette if you want to see :D

8:11 Raynes: Sure.

8:12 etate: http://gist.github.com/331310

8:12 Raynes: Holy shit. I just crashed the Java VM.

8:12 http://gist.github.com/331311

8:13 etate: libc :(

8:13 Raynes: etate: That looks very good.

8:14 I'm not sure what caused that.

8:14 It scares me.

8:14 etate: Raynes: thanks, i havent used it for anything but clojure code yet though so dunno how it looks in other langs

8:14 Raynes: hmm that looks like a Java function too, scary

8:14 Raynes: It is a Java function.

8:15 Oh.

8:15 I don't think it's static.

8:15 But I also don't think crashing the VM is a good way to let me know that it isn't static. :o

8:15 Yep.

8:15 That was it.

8:15 :o

8:16 etate: Raynes: man i must have crashed the JVM about 100 times yesterday

8:16 Raynes: It's not crashing it now. Not sure what went wrong.

8:17 LauJensen: You got a core dump when it happens Raynes

8:17 Raynes: I don't want to know.

8:17 I'm mortified.

8:18 (doc rand-int)

8:18 clojurebot: "([n]); Returns a random integer between 0 (inclusive) and n (exclusive)."

8:19 LauJensen: I see I've deleted my old .emacs with the ERC setup... Raynes help

8:19 :)

8:20 Raynes: I don't have an ERC setup.

8:20 I don't use it.

8:23 LauJensen: ~ping

8:23 clojurebot: PONG!

8:24 Raynes: ~pong

8:24 clojurebot: PONG YANG!

8:26 LauJensen: Hmm, hooking ERC highlighting directly into libnotify, sweet :)

8:27 Raynes: I think that is why I never used ERC. I couldn't figure out how to get name highlighting working or something.

8:27 LauJensen: hehe

8:28 Youre a strange guy Raynes, you learn Lisp without much difficulty, yet you stumple when setting up nick highlighting :)

8:28 Raynes: I know, I know. :p

8:48 etate: man, clojure is making me like the jvm more and more

8:49 LauJensen: etate: It really has that effect on people

8:51 etate: LauJensen: I used to use CL for pretty much all my code but I'm seriously considering switching, and dealing with the learning curve

8:52 LauJensen: etate: If you're serious about writing quality code, I recommend switching sooner than later

8:53 * The-Kenny thinks Clojure is *way* more practical oriented than CL.

8:54 etate: LauJensen: yeah, i'm used to having side effects where I like so its a big mind shift. But it seems like its forcing me to write short, concise functions that work so its a good start. :)

8:55 LauJensen: Indeed

8:55 And also these super powerful core datatypes, which all implement the same interfaces and are all immutable is the gift that keeps on giving :)

8:58 etate: LauJensen: yeah i think thats actually one of the best things in clojure, generic sequences, and the ability to add your own

8:59 LauJensen: but the way it interoperates with Java is great too

9:00 seems like great decisions were made in the design... like the addition of maps etc, and destructuring on them in lets is just great

9:01 the only thing i'm missing at the moment is proper clojure indentation in emacs

9:25 LauJensen: Wasn't there a link to color-theme-bliss in here? Somebody plz paste

9:33 etate: LauJensen: i just made a new one that is darker, the one i'm currently using, wanna see?

9:34 LauJensen: dark-bliss: http://gist.github.com/331310

9:34 LauJensen: etate: I'm not sure. I was running through my themes and I saw color-theme-bliss and I actually loved it, was that the one you wrote ?

9:35 Can you paste the first one again please?

9:35 etate: LauJensen: yeah its the one i wrote: http://gist.github.com/331038

9:35 LauJensen: Thats not the one I'm thinking of though

9:36 Found it - Its the dark one

9:36 etate: LauJensen: dark-bliss ? :)

9:36 LauJensen: The problem is that its broken, so you cant load the dark one, without loading the standard version first, can you fix that ?

9:37 Raynes: I've now made a ERC config which works with Ubuntus libnotify for highlighting, will you start using if I blog about it ? :)

9:37 etate: LauJensen: if you restart emacs and then load the dark theme it works i think?

9:37 LauJensen: Lemme try

9:38 etate: LauJensen: if you use multiple color-themes it sometimes messes up, i think its a color-theme problem

9:38 LauJensen: (color-theme-dark-bliss)

9:38 *** Eval error *** Wrong type argument: listp, color-theme-bliss

9:38 Raynes: LauJensen: Probably.

9:39 etate: LauJensen: I put the defun after (require 'color-theme) in emacs, then i just do M-x color-theme-dark-bliss

9:39 LauJensen: No dice

9:40 etate: LauJensen: I used to get this error before on windows using a weird version of color-theme, what version are you using? (of emacs & color-theme)

9:40 LauJensen: e23, no ide aRE c-t

9:41 etate: LauJensen: oh thats because i made a mistake in the code, my bad

9:41 LauJensen: i'll paste the fixed version

9:41 LauJensen: Fantastic - I've found a new color-theme ! Thanks a ton!

9:42 etate: LauJensen: http://gist.github.com/331346

9:42 :) no worries, i wanted to try my hand at making one was getting tired of calm-forest & charcoal-black hehe

9:43 LauJensen: This is by far my favorite

9:43 pjackson: /join #startups

9:43 oops

9:44 etate: LauJensen: cool, i'll make more in the future then :D

9:44 CloudiDust: Greetings #clojure, I am now beginning to learn clojure, and I wonder why the exceptions thrown when a name cannot be resolved is the most generic java.lang.Exception, not something more specific? Could you please tell me the ideas behind the decision?

9:47 LauJensen: etate: I've put it in clojure-theme-library but the symbol isn't evaluated when parsing .emacs, any idea why ?

9:50 etate: LauJensen: hmm the defun isn't evaluated?

9:51 LauJensen: Nope

9:51 But the rest of the library themes are

9:51 etate: LauJensen: oh i didn't install it into the standard libraries, i just made it into a callable defun so that would be why, not sure how to install it into the main themes

9:52 standard libraries should be standard themes

9:52 LauJensen: Ah ok

9:52 np

9:52 etate: LauJensen: i'll look into it for next time :)

9:54 LauJensen: This is great - ERC/libnotify integration and a shiny new color-theme all in the same hour

9:57 etate: :D

9:57 anyone have any idea why when i compile my SWT app it all seems to run but no window displays?

9:58 LauJensen: etate: I'm guessing it has to do with your code

9:59 etate: LauJensen: i'm trying to run ogre4j in clojure, the init printlns seem to indicate at least that it is loading ogre properly, but shell.open() etc don't seem to do anything... weird thing is the code works, as in it recognizes that the shells / windows actually exist

10:04 in case anyone knows: http://paste.lisp.org/display/96330

10:41 LauJensen: ~ Lau?

10:41 clojurebot: No entiendo

11:37 technomancy: LauJensen: can you paste your erc/libnotify elisp?

11:38 LauJensen: ~paste

11:38 clojurebot: lisppaste8, url

11:38 LauJensen: technomancy: no sorry :)

11:38 technomancy: lisppaste8 isn't registered =\

11:39 scpaste never lets me down. =) (http://p.hagelb.org)

11:39 LauJensen: aaaah

11:40 I really like Gist integration in Emacs

11:40 technomancy: that's pretty good too

11:40 but more moving parts means more can go wrong

11:40 gist is more reliable than pastie was though

11:40 LauJensen: http://paste.lisp.org/display/96331

11:41 (I admit, I'm no elisp coder)

11:41 technomancy: cool, thanks

11:41 ok, say my name so I can test?

11:42 LauJensen: technomancy: testing

11:42 technomancy: cool; works nicely

11:42 LauJensen: excellent

11:42 technomancy: though I don't have emacs.svg in that location

11:45 found it... that's quite nice

11:49 LauJensen: Oh I actually thought that was standard

11:49 I'll strip it in case I blog about it

11:50 technomancy: it's probably standard if you install from apt

11:50 rather than from source

11:52 LauJensen: Still - Absolute paths are regrettable

12:06 technomancy: Looking at the manpage I think you should add a "-u critical" as the first 2 params to notify-send, to ensure that they'll be shown

12:12 technomancy: aha

12:57 etate: can you create abstract java classes in clojure?

13:01 underdev: i know this is may be crossing the boarder into a emacs question, but does anyone know how to make the clojure source available to slime for all that "jump to definition" goodness?

13:01 expand macro, etc

13:09 vy: underdev: It's implemented within swank protocol, Clojure supplies that value to SLIME.

13:09 LauJensen: underdev: If your jars contain the source, this should work out of the box

13:10 etate: some Java functionality has to be gen-classed before it can be used right?

13:10 underdev: vy, LauJensen: ty

13:10 vy: underdev: See find-definitions-for-emacs in src/main/clojure/swank/commands/basic.clj:313

13:13 underdev: vy: thank you

14:03 etate: whilst using gen-class, is there way to name your files hello-world instead of having to do hello_world ?

14:04 StartsWithK: etate, use java convention for class names

14:04 ns1.ns2.HelloWorld

14:05 etate: StartsWithK: okay

14:23 joshua-choi: My gosh, I've finally found the source of a strange bug

14:23 (= [1 2] (list 1 2))

14:24 That means if you (def g (memoize f)), if (not= (f [1 2]) (f (list 1 2))), then (g [1 2]) followed by (g (list 1 2)) is going to return the incorrect value

14:24 Ugh

14:25 Is there a way to test for equality for Clojure vectors and lists that includes type equality?

14:26 chouser: there are more than one kind of vector, and more than one kind of thing that looks like a list

14:26 how specific do you want your type equality to be?

14:27 vy: chouser: More than one kind of thing that looks like a list? Like what?

14:28 chouser: ,(cons 1 nil)

14:28 clojurebot: (1)

14:28 chouser: (list 1)

14:28 ,(list 1)

14:28 clojurebot: (1)

14:28 chouser: ,(map type [(cons 1 nil) (list 1)])

14:28 clojurebot: (clojure.lang.PersistentList clojure.lang.PersistentList)

14:28 chouser: d'oh

14:28 StartsWithK: , (= (list 1 2) (doto (java.util.ArrayList.) (.add 1) (.add 2)))

14:28 clojurebot: true

14:28 vy: joshua-choi: Maybe: (= (seq [1 2]) (list 1 2))

14:28 chouser: ,(map type [(cons 1 '(2 3)) (list 1 2 3)])

14:28 clojurebot: (clojure.lang.Cons clojure.lang.PersistentList)

14:29 chouser: ,[(cons 1 '(2 3)) (list 1 2 3)]

14:29 clojurebot: [(1 2 3) (1 2 3)]

14:29 vy: chouser: but

14:29 ,(= (cons 1 '(2 3)) (list 1 2 3))

14:29 clojurebot: true

14:29 joshua-choi: chouser: The problem for me is that (memoize f) will return the same thing for [1 2] and (list 1 2), even if (not= (f [1 2])) (f (list 1 2))).

14:30 It creates very subtle, stateful bugs depending on if you call (f [1 2]) or (f (list 1 2)) first.

14:30 I have no idea what to do, other than stopping memoizing

14:30 chouser: vy: exactly

14:31 vy: joshua-choi: Writing a wrapper function that calls "seq" over its argument can be an option.

14:31 chouser: but he doesn't *want* [1 2] to be treated the same as (1 2)

14:32 vy: Doesn't he? Oh, sorry then.

14:32 chouser: joshua-choi: my point is that you haven't yet specified the behavior you want instead

14:32 should (cons 1 '(1 2)) be treated the same as (list 1 2 3)?

14:32 LauJensen: joshua-choi: How about adding type-checking to memoize?

14:33 joshua-choi: Let's say I want to memoize constantly. (def g (memoize constantly)) will change its behavior depending on if you call (g [1 2]) or (g (list 1 2)) first.

14:33 Why would I need to memoize constantly? It's just a stand-in for a more complex function-returning function.

14:33 Why do I need to distinguish between lists and vectors? I'm writing a Clojure-in-Clojure parser, so it matters.

14:34 I'm not sure what to do. :(

14:34 chouser: so do you want (cons 1 '(1 2)) be treated the same as (list 1 2 3) or not?

14:34 should each of them be treated the same as (range 3) or not?

14:35 joshua-choi: I'm not sure. Well, let's find out:

14:35 ,(eval (cons 1 '(2 3)))

14:35 clojurebot: DENIED

14:36 joshua-choi: Oh, dang.

14:36 Good, it works in my REPL.

14:36 Yes, I'm not distinguishing between cons-cells and lists, but I am distinguishing between lists/cons-cells and vectors.

14:37 This is the same behavior of the standard eval function.

14:39 Well, the only thing I can do is simply to not memoize my function. A shame, because it's computationally expensive, but there seems to be nothing that I can do.

14:40 I've got to go; I wonder if I should roll my own memoize function...

14:40 chouser: you may have to write your own memoize, which is really not very hard

14:40 joshua-choi: Yeah, you're right about that. :)

14:42 chouser: hehe

14:42 (eval ['do 1]) ;=> 1

14:44 defn: what are the new super fancy changes to swank-clojure?

14:44 im dying to know

14:47 when im using -'

14:48 err, when im using lein, how do -'s translate again? I use a hyphen in the (ns foo-bar), but then use an underscore in the filename and then refer to it with an underscore in hte project.clj?

14:49 * defn can never remember this

14:51 * StartsWithK thinks _ and - should not be valid characters in ns names..

14:51 underdev: speaking of swank-clojure, i installed lein for the first time. I created a new project using lein new, downloaded the jars with lein deps, but when i try swank-clojure-project, i hang at "Polling "/tmp/slime.6217""... any idea what i'm doing wrong?

14:56 do i just M-x slime manually? the error seems to have gone away...

14:57 after manually starting slime

15:00 The-Kenny: underdev: If it hangs, take a look at the *inferior lisp* buffer

15:01 There's the output of clojure before slime is started

15:01 underdev: The-Kenny: okay! ty

15:01 maybe i can figure it out from here...

15:02 The-Kenny: Maybe you forgot to add swank-clojure to the dependencies of the project

15:02 remleduff: underdev: Do you have swank-clojure in your deps

15:02 underdev: yepper

15:02 that's it

15:02 remleduff: Bah, The-Kenny beat me

15:02 The-Kenny: (:dev-dependencies [[swank-clojure "1.1.0"]])

15:02 underdev: thanks guyd

15:02 guys*

15:02 remleduff: I had the same problem yesterday :)

15:02 Took a while to figure out because swank-clojure doesn't come up when you search on clojars

15:07 underdev: w00t!

15:09 omg so cool!

15:17 LauJensen: underdev: ex rubyist?

15:18 underdev: a little rails. mostly tcl.

15:18 w/ vim

15:20 LauJensen: k

15:20 giacecco: Lau: hi, I've developed in Ruby until a couple of years ago

15:22 LauJensen: k :)

15:22 underdev: i remember when i first checked out ruby, i told my wife "the guy who writes an application server in this is going to go to conferences and stuff"

15:23 LauJensen: Yea so.. If you guys want to talk Ruby I suggest you log off the internet :)

15:23 giacecco: I still like Ruby a lot, but I got to an age when I need something different than traditional procedural languages

15:23 hiredman: an age?

15:23 giacecco: almost 40

15:24 I stopped programming for work ages ago, now I do programming just in my spare time, with the same care you would have for a valuable model of... a wooden ship, for example

15:25 underdev: I was digging in the instant ruby download on windows, and there was a folder called tcl. I looked inside, found a repl... and that was it... "its like scheme! That does things! Without the parenthesis!"

15:26 giacecco: it's been a while since I last touched Ruby, but I don't feel like that the two languages are that close, am I wrong?

15:26 LauJensen: Which two, Ruby and Clojure?

15:27 giacecco: y

15:27 LauJensen: No I'd say they are almost as different as 2 languages can get

15:27 underdev: (ruby includes tcl for access to tk... and i will shut up about it now

15:29 giacecco: Lau: ok, I wasn't wrong then

15:29 need to leave guys, I'll be back

15:29 Raynes: hiredman: ping

15:29 LauJensen: c u :)

15:30 defn: ruby and clojure have some similarities

15:30 Raynes: Yep. Like cup and pond have some similarities.

15:31 defn: but i dont think it's useful to think about them

15:31 Raynes: im just saying -- they arent exact opposites -- there is some love for lisp in ruby

15:32 raek: as long as you only use one lambda... ;)

15:32 defn: heh

15:33 * raek is backing off to avoid a language fight

15:33 defn: there's no fight here

15:34 i rather enjoy ruby for some reasons, and i enjoy clojure for others, but they do have a few similarities that don't make them mortal enemies

15:36 chouser: @x = @x + 1 # uncontrolled mutation of instance member!!

15:37 defn: :)

15:37 underdev: syntax... meh

15:37 arohner: ruby has about as much love for lisp as java does for smalltalk

15:39 raek: one thing I love clojure got right from the beginning (thanks to java getting it right) is the distinction of bytes and characters

15:39 defn: you get some macro functionality in ruby, you get a bunch of functional methods

15:45 i need an efficient way to tag lists and then search those tags

15:48 underdev: defn: make the lists the values of a map, and the tags the keys?

16:03 hiredman: Raynes: pong

16:03 Raynes: How did you manage to set clojurebot's name?

16:04 setName is protected, and you can't create your own constructors with proxy.

16:04 hiredman: http://github.com/hiredman/clojurebot/blob/master/src/hiredman/clojurebot/core.clj#L410

16:05 Raynes: Oooh. Hax.

16:05 Chousuke: I like the name

16:06 hiredman: it was in contrib, but I think it got renamed recently

16:06 Raynes: It's a cute little hack.

16:06 And useful.

16:07 hiredman: pircbot also has a changeNick method

16:07 Raynes: Of course it does.

16:07 hiredman: but you cannot call it until you are already connected to the server

16:08 so the utility is limited

16:08 Raynes: Oh.

16:14 etate: did you guys check out my latest colour-theme btw?

16:18 Fossi: haxhax

16:18 reflectionism

16:20 i bet you can wreak havok with that

16:28 LauJensen: Where do I find that IntelliJ Clojure plugin ?

16:29 Apage43: It's "La Clojure"

16:29 http://plugins.intellij.net/plugin/?id=4050

16:32 LauJensen: Thanks

17:23 dcnstrct: hi. I would like to catch two different exceptions inside my try block and handle them both with exactly the same behavior. Do I need two catch statements or is there some way to combine them ?

17:25 begin; something_that_throws(); rescue FooException, BarException, BazException; some_behavior; end

17:25 that's how it would be done in Ruby

17:29 arohner: dcnstrct: you can use two catch statements, or write a macro

17:29 dakrone: dcnstrct: I believe you can have 2 catch statements

17:30 ,(try (/ 1 0) (catch FileNotFoundException _ (println "foo")) (catch Exception _ (println "bar")))

17:30 clojurebot: dakrone: Excuse me?

17:30 Fossi: is there a way to AOT compile all gen-classes without naming them?

17:30 dcnstrct: I wanted to print foo both time so I was hoping to not have to duplicate the: println "foo"

17:31 I like the macro idea.. because I'm going to be using this in several places

17:31 thnx

17:31 Fossi: with-logged-exception

17:53 can you gen-class abstract classes?

18:01 hmmm. maybe i'm really "doing it wrong" (tm)

18:02 sramsay: Trying to run Volkmann's snake.clj, and it's giving me an EOF error.

18:02 clojure and contrib 1.1.0

18:03 Can't see anything wrong with the file . . .

18:04 Anyone know what "EOF while reading (snake.clj:259)" means?

18:04 259 being the last line.

18:05 ska2342: sramsay: missing closing paren, missing end-of-string-quote.. sth like that probably

18:05 sramsay: Yeah, but I've been all over the code looking for unbalance parens.

18:05 Can't see it.

18:05 Does clojure have a syntax checker?

18:06 ska2342: sramsay: where's the file?

18:06 sramsay: http://java.ociweb.com/mark/programming/ClojureSnake.html

18:07 Fossi: emacs got one. it's called paredit ;p

18:08 ska2342: sramsay: it compiles just fine over here.

18:08 sramsay: ska2342: What OS?

18:09 dcnstrct: b

18:09 err

18:09 sramsay: I'm trying it run it like: java -server -cp ${HOME}/local/clojure/clojure.jar:${HOME}/local/clojure-contrib/clojure-contrib.jar clojure.main snake.clj

18:09 clojurebot: clojure euler is http://clojure-euler.wikispaces.com/

18:09 sramsay: Is that part of my problem?

18:09 ska2342: sramsay: osx (bless me) but that should not be relevant. Your problem is with the reader.

18:10 sramsay: I'd say you accidentally erased a char or missed one while copying

18:10 sramsay: k. I'll try it again, then.

18:11 thx.

18:19 hiredman: ther is a &lt; in the middle of the source

18:20 at least two, maybe more

18:21 ska2342: hiredman: in same-or-adjacent-cell? ?. Seems to depend on the browser, for me those two are displayed (and copied) as <

18:22 sramsay: hiredman: Yeah, I can't see that in my source. It really looks clean.

18:22 hiredman: I changed them to > and the eof exception went away

18:22 sramsay: hiredman: It does seem like the reader is bothered by the encoding, somehow.

18:23 hiredman: java on mac defaults to some silly mac encoding

18:23 Mac Roman

18:23 but I doubt that is the problem

18:23 clojurebot: "There is no problem in computer programming which cannot be solved by an added level of indirection." -- Dr Maurice Wilkes

18:23 hiredman: clojurebot: thanks!

18:23 clojurebot: Pardon?

18:24 hiredman: so I did view source on the webpage and copied the code from their

18:24 there

18:24 he really should have a link to the file

18:24 sramsay: I tried wget (and remove HTML), and then c&p into bbedit.

18:24 hiredman: and his use of if at the end instead of when is really not good style

18:25 ska2342: sramsay: I marked, copied into emacs and saved. Ah, emacs... ever dealt with strange chars and checked C-u C-x = ?

18:27 hiredman: in addition it doesn't even work. When I call a CLJ from the command line like sramsay posted some minutes ago *command-line-args* is nil

18:28 sramsay: hiredman: Yeah, that part is confusing me (I'm a clojure newbie).

18:28 hiredman: sure

18:28 you have to add an argument

18:28 … snake.clj foo

18:28 sramsay: hiredman: Though not a newbie to osx, lisp, unix, or this kind of irritating problem ;)

18:28 hiredman: it looks like this is kind of bitrotted

18:29 ska2342: hiredman: as the comment says .. earlier versions seem to have left the path over there.

18:29 sramsay: hiredman: Actually, I tried that foo thing too! trying again . . .

18:30 hiredman: it worked for me

18:30 sramsay: Making progress! Now starts and quits without error. Also, without opening a window. :P

18:30 hiredman: but the game seems to run by itsself, always to the same conclusion in an infinite loop

18:31 ska2342: I just wrote (main) down there and skipped the test. It's my private copy anyway...

18:31 sramsay: Worked!

18:31 Thanks, everyone.

18:31 ska2342: hiredman: arrow keys to eat the red "apples", after eating some 10 of them, you win. OK, and then it will repeat

18:32 hiredman: ska2342: not here

18:32 here everything happens to fast for keypresses

18:32 sramsay: Ah, yes. Should respond to the arrow keys, yes?

18:32 hiredman: the worm runs into the side of the window with a bunch of red squares blinking in and out around it

18:33 sramsay: Funny, it suddenly started responding to arrow keys.

18:33 So, just for the record . . . This is not the best example code from which to learn the language? ;)

18:33 hiredman: he also should be proxying an adapter instead of keylistener

18:33 I dunno, I guess if you get it to works it's not that bad

18:34 sramsay: Thanks for the help everyone.

18:34 hiredman: it's very, uh, workman like? no bells no whistles

18:35 ska2342: there is a parameter ms-per-move which you may be able to adapt so that the Thread/sleeps a little longer.

18:35 hiredman: (volkmann like!)

18:36 ska2342: Revealing my ignorance of Java... what's that about the adapter instead of keylistener? Can you point me to sth to read?

18:37 hiredman: well he proxy's the interface KeyListener and has to put in empty bodies for methods he doesn't care about

18:38 * ska2342 is off to java docs searching for Adapter

18:38 hiredman: KeyAdapter is a (maybe abstract?) class that implements KeyListener

18:39 ska2342: yes, it's abstract and it only exists to avoid the empty method defintions as it seems. Thx for the insight

18:41 hiredman: it's not a huge thing, it is nice to have

18:42 ska2342: nice to know and feels strange that this should live in the standard lib. whatever

18:43 hiredman: the java standard lib is huge

18:47 * ska2342 just read http://java.sun.com/docs/books/tutorial/uiswing/events/generalrules.html#eventAdapters

19:06 vIkSiT: hi all

19:07 I'm looking for some tips about how to manage a) the number of jars that seem required for projects and b) how do you get out of dependency hell using lein.

19:08 for instance, i was trying out a tutorial that requires clj-http and clj-oauth

19:08 I got the sources from github and tried to compile using lein/ant

19:10 but am running into dependency hell (different deps requirements for lein and projects/and my own jars in /opt/jars that have clojure etc)

19:11 hiredman: http://clojars.org/search?q=oauth

19:11 why are you building it?

19:12 "dependency hell" is a striking image, but doesn't convey any real information

19:13 vIkSiT: hiredman, interesting, I didn't know about clojars.

19:13 well, "dep hell" - refers to - recurisve need for libraries that I wanted to use

19:13 recursive*

19:14 hiredman: what do you mean recursive need?

19:14 you mean you have a circular dependency?

19:14 (I doubt that)

19:14 have you read the lein readme?

19:16 vIkSiT: hiredman, more like a neverending dependency. For instance, clj-oauth required clj-http, which in turn requires com/twinql/clojure/http.. and so on .

19:16 hiredman, reading right now.

19:16 although one thing confuses me

19:16 hiredman: if libraries have a circular dependency you should file a bug with the maintainer

19:17 vIkSiT: lets say the project.clj for a library I'm trying to use has this : http://gist.github.com/331656

19:17 hiredman: why are you looking at the project.clj?

19:17 vIkSiT: now, doing a lein deps would get these files from wherever, and put them into lib/ ?

19:17 hiredman: yes

19:17 vIkSiT: hiredman, well, i'm trying to build the library

19:17 hiredman: why?

19:17 clojurebot: why not?

19:18 hiredman: just put the requirement in the project.clj for your project

19:18 vIkSiT: hiredman, because i want to use the library in my own program as a starting point to modifying it for my own needs..

19:18 the plan is to have say, a project call test1 use this library locally (not through lein or clojars) so that I can keep iterating on both modifications to the library and test1

19:19 hiredman: why not through lein?

19:20 vIkSiT: hiredman, I thought lein is like easy_install or apt-get - fetches only from repos?

19:20 hiredman: thats why you should read the reame

19:20 readme

19:25 vIkSiT: hiredman, hmm which specific part of the readme do you mean?

19:25 I'm not sure I see anything that relates to local dependencies

19:26 or do you mean using lein jar to create a jar and then use it?

19:28 hiredman: clj-oauth checks out and builds fine

19:29 vIkSiT: hiredman, lein deps; ant ?

19:30 hiredman: uh

19:30 you use one or the other

19:30 technomancy: vIkSiT: there's a thread on the leiningen mailing list about "checkout dependencies" where you could modify two libraries in parallel without having to do "lein install" in one and then "lein deps" in the other to share changes

19:30 hiredman: lein jar, or ant

19:30 vIkSiT: this is what I was getting, btw: https://gist.github.com/05445c6714e050205169

19:30 technomancy: but it's pretty experimental right now

19:30 vIkSiT: using ant.

19:31 technomancy: vIkSiT: if you are planning on using that functionality I'd be interested in your input on that thread

19:31 and whether the approach suggested would work for you

19:31 vIkSiT: technomancy ah - let me try to find that entry

19:31 thanks for the info

19:31 hiredman: vIkSiT: use lein, don't use ant

19:32 vIkSiT: and I think I realize what the difference is here. lein deps will _compile_ while taking into account dependencies. vs ant, which will look for the relevant jar files in the cp

19:32 technomancy: leiningen and ant are mortal enemies. (see c. stephenson's work on the subject)

19:32 hiredman: vIkSiT: lien deps doesn't compile anything

19:32 vIkSiT: i see. so, lein deps and then lein jar to a) get deps, and b) create jar ?

19:32 hiredman: just run lein jar

19:32 and read the readme

19:32 vIkSiT: technomancy, heh right

19:33 hiredman: clj-apache-http also checks out and builds fine

19:54 vIkSiT: hmm. so lets say I was trying to include technomancy's clojure-http-client as a dependency for my project. I can't seem to find it on clojars.org either

19:54 recommended way using lein?

19:56 The-Kenny: vIkSiT: Here's c-http-client on clojars: http://clojars.org/clojure-http-client

19:56 search is a bit buggy there

19:56 vIkSiT: errr

19:56 thanks, The

19:56 thanks, The

19:56 thanks, The-Kenny

19:56 technomancy: vIkSiT: clojars search is currently limited to projects that include descriptions... it's a bug

19:57 vIkSiT: oops sorry for the multipaste.

19:57 ah I see

19:57 technomancy: vIkSiT: you can determine the dependencies invokation by looking at clojure-http-client's project.clj file

19:57 *invocation

19:57 vIkSiT: right.

19:58 but lets say this jar wasn't on clojars; i'd then have to clone the git rep, use lein jar to build, and then have to copy it manually into lib.

19:59 technomancy: the best thing to do in that case is to alter the group id and push it to clojars yourself

19:59 that's described under "publishing" in the leiningen readme

19:59 vIkSiT: at that point, adding it as a dependency into project.clj wouldn't really be much use would it? I would still have to specify a build.xml etc etc (the nasty ant method)

19:59 technomancy, ah hmm

20:00 so there is no acceptance policy for lein repos?

20:00 in the sense, I could push pretty much anything tehre, unlike say, an apt-get repo which is reviewed etc

20:00 technomancy: yes

20:01 vIkSiT: I see

20:01 technomancy: the decent thing to do is use a custom group-id (org.clojars.viksit) unless you are the original author

20:01 but it's not enforced

20:01 vIkSiT: ah sure

20:01 tomoj: I'm interested in hosting my own repo

20:01 so I could push whatever I want there

20:01 is this a maven problem?

20:02 and, how could I make lein give my repo priority?

20:02 (again, is that a maven problem? I'm lost..)

20:02 technomancy: tomoj: you can run your own clojars instance

20:02 it's open source

20:02 tomoj: aha

20:02 great

20:02 _ato, right?

20:02 technomancy: I think you can give your repo priority by editing ~/.m2/settings.xml, but I'm not sure about the details there.

20:02 yeah

20:03 you could do it using raw maven too, but it would be less fun

20:03 tomoj: ok, that's great too, I can modify everyone's settings.xml with chef

20:03 technomancy: actually you could even just rsync ~/.m2/repository to an http-readable location

20:03 that's all it takes; very simple

20:03 tomoj: oh, hmm

20:03 * technomancy did that for a while before clojars was made

20:04 tomoj: I think I'll be building recipes for running clojure code, so it might be easier just to run clojars

20:04 technomancy: tomoj: if you run into issues with priorities of different repos please file a lein issue

20:04 tomoj: will do

20:04 technomancy: I don't know how it will resolve questions of ordering

20:04 tomoj: yeah..

20:05 having to put that in every project.clj seems weird though

20:05 be nice to have a system-wide way of setting which repos lein uses

22:17 joshua-choi: Are there any Clojure data kinds whose objects can equal an object of a different kind? Such as lists equaling cons-cells equaling vectors.

22:19 Other than the example I gave of course.

22:20 clojurebot: examples is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples

22:21 tomoj: joshua-choi: numbers maybe?

22:21 joshua-choi: Mmm. Yes, that's true.

22:22 tomoj: Numbers and IPersistantCollection are the only special cases in clojure.lang.Util/equiv

22:22 joshua-choi: Any cases of IPersistentCollection other than lists/cons/vectors? Like maps, sets, I dunno.

22:23 * joshua-choi thinks that the memoize function's docs should have a warning that = is used to compare arguments

22:24 hiredman: joshua-choi: memoize expects to the fn to be a pure function and the input and output to immutable values

22:24 joshua-choi: More specifically, that giving vectors and lists to the memoized function must return the same results.

22:24 hiredman: oh

22:24 right

22:25 *that*

22:26 joshua-choi: It's obvious in retrospect, but it was the culprit of an insidious, changing bug that I'm still fuming about :)

22:26 tomoj: ,(map coll? [() [] {} #{} clojure.lang.PersistentQueue/EMPTY])

22:26 clojurebot: (true true true true true)

22:26 tomoj: yet,

22:27 ,(= [[1 2]] {1 2})

22:27 clojurebot: false

22:27 hiredman: almost all deftypes will implement IPersistentCollection

22:27 tomoj: if I recall the rationale was someting about maps not being ordered

22:27 tomoj: ,(= [(first {1 2})] {1 2})

22:27 clojurebot: false

22:27 tomoj: ah

22:28 and sets aren't ordered either

22:29 ,(= [1] (sorted-set 1))

22:29 clojurebot: false

22:29 hiredman: linearly ordered?

22:29 I don't know

22:32 technomancy: joshua-choi: I've wondered about that equality puzzle myself.

22:32 I suppose the difference is that maps and sets have very different value semantics since they're generally unordered

22:33 whereas the differences between lists and vectors have to do with perf characteristics and insertion behaviours

22:33 which arguably do not affect value

22:33 joshua-choi: Unfortunately, they also affect eval's behavior, and only one of them is a function

22:33 technomancy: still not sure I'm entirely comfortable with vectors ever being = to lists, but I suspect that's the reasoning behind it

22:34 joshua-choi: That was difference enough for this bad memoize bug I had

22:34 technomancy: agreed; it breaks in unexpected places

22:34 and I can't think of any circumstances where you'd actually want it to work that way

22:35 well; that's not true; I guess it's good that (map identity my-vec) is = to my-vec

22:35 sort of

22:35 it's definitely not clear-cut

22:37 psykotic: hmm

22:38 this comes down to equality being messy. it really depends on context what you want.

22:39 clojure's behavior is definitely useful 99% of the time, when you want to pretend that a sequence is a sequence

22:39 hiredman: technomancy: is it possibly to run lein new from the repl?

22:40 technomancy: hiredman: sure; all tasks are just functions

22:40 it's going to use the cwd though, which you can't override

22:40 might be a drag

22:40 hiredman: :/

22:40 technomancy: could create it then move it

22:40 hiredman: I saw a factor video and I am suffering from repl envy

22:41 psykotic: fuel?

22:41 technomancy: factor's repl is slick

22:41 we could make new take a target directory as an optional argument

22:41 hiredman: they have some command to run in the repl to generate a new project structure

22:41 psykotic: hiredman: link to video?

22:41 hiredman: uh

22:42 hmmmm, I think it was a presentation to philly λ

22:43 I downloaded it a while a go and just got around to watching it

22:43 technomancy: hiredman: if you haven't seen the fuel video you should watch that too

22:43 factor's shaping up to be my 2011 language

22:43 hiredman: http://vimeo.com/6203360

22:44 psykotic: technomancy: have you looked at alien, their ffi? it's super nice

22:44 probably the only nicer ffi i've seen is haskell's

22:44 hiredman: technomancy: where?

22:44 technomancy: I wouldn't know how to judge an FFI, not knowing C

22:44 psykotic: fuel is kind of slime for factor

22:45 hiredman: ohhh

22:45 yeah that got mentioned in the video

22:45 technomancy: http://factor-language.blogspot.com/2009/01/screencast-editing-factor-code-with.html

22:46 psykotic: heh, i figured out a nice way of doing "fake" forward type/tag propagation for the kind of things where type inference is combined with type classes for dispatch in haskell

22:46 i'll gist it

22:47 hiredman: ,:o

22:47 clojurebot: :o

22:47 psykotic: http://gist.github.com/331761

22:51 so, the point is that when you use bind/unit, rather than choose which monad to use right there, it parameterizes over all possible monads using the (fn [t] ...)

22:51 only when (run ...) is only done is the t specified, and it's propagated throughout the monadic pipeline

22:51 so, you can write something like (unit 42) and you don't have to say 'this is unit 42 in the callcc monad'

22:52 in haskell, if you write 'return 42' it becomes a value of polymorphic type Monad m => forall (m :: * -> *). m Integer, so i'm basically doing the same thing

22:57 the '(fn [t] ...)' in my clj code corresponds to the forall m in that type sig

23:52 somnium: what do people make of this kind of syntax twiddling? http://paste.lisp.org/display/96355 (sort of trying to imitate ml style)

23:53 matter of taste or a bad idea?

23:55 psykotic: i'm not a fan of leaving out the parens on the forms

23:59 somnium: I go back and forth, but been exprimenting with ocaml and F# and a little jealous of ther readability at times

23:59 s/ther/their

Logging service provided by n01se.net