#clojure logs

2010-03-13

00:00psykoticremleduff: you have to write some code
00:00somniumremleduff: `M-x customize-group auto-complete` and add clojure-mode, slime-repl-mode etc to modes
00:01psykoticsomnium: won't he need to write a function for calling auto-complete with the completed symbols, etc?
00:01somniumwell, the stuff at the top of the .el you can just copy-paste iirc
00:02somniumpsykotic: oh, for slime integration? that would take some tweaking
00:03psykotici dug through slime.el a bit, and he could try calling slime-simple-completions for a start
00:03somniumjust leaving a clojure.core buffer open seems to do a fair bit of work
00:03psykoticthat should just return a list of symbol directly, without any window/buffer ceatiocreation, etc
00:03remleduffActually, it seems to work out of the box in a clojure-mode buffer
00:03remleduffJust not in the repl
00:04psykoticreally?
00:04psykoticoh, because it does dexpand-style buffer sniffing?
00:04psykoticdabbrev even
00:04remleduffNo idea what that means
00:04psykoticdabbrev looks at all open buffers as a source for completions
00:05psykotici guess it uses it as a default source
00:05remleduffI don't have any buffers open that have "some" in them
00:05psykoticdunno in that case
00:06remleduffBut if I do "(so" and wait, it prompts me with a list of symbols that start with so including some
00:12psykotici like the typical way autocompletion of the top candidate tends to work in url location bars in web browsers
00:13psykoticie you start typing, it suggests the top completin 'inline', and if you press enter at that point, it just accepts the completion
00:14psykotic99% 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
00:21remleduffI 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
00:22remleduffIf I do, "M-." to jump to a definition using swank-clojure, why can't I "M-*" to jump back to where I was?
00:22remleduffCrap, I can
00:22remleduffI was doing C-*
00:24technomancyI always use M-, for that
00:25remleduffAh, that's much better, thank you
00:33kwertiiis 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...
00:34technomancykwertii: someone mentioned having that problem a few days ago
00:35technomancybut they didn't report a bug or anything, so I don't have a way of following up on it. =\
00:35kwertiitechnomancy: do most people get real line numbers when they do this? :)
00:35technomancykwertii: you should for C-c C-k. the other methods don't provide line numbering info right now.
00:36tomojwhat's C-c C-k bound to?
00:36kwertiitechnomancy: would it matter if I had already loaded the file with C-C C-L before doing the C-k?
00:36technomancyslime-compile-and-load-file
00:36technomancykwertii: no, it shouldn't make a difference
00:36tomojhmm
00:36technomancytomoj: slime inherits a load/compile distinction from CL that doesn't make sense in clojure
00:38kwertiitechnomancy: ah. it works. thanks :)
00:39tomojstrange
00:41kwertiitomoj: 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
00:43kwertiitechnomancy: are there any plans (or is it even possible to) get the full SLIME debugger stuff working with Clojure?
00:43tomojI saw some stuff on the swank-clojure mailing list recently about it, I think
00:43technomancykwertii: hugod is working on some cool debugger repl stuff, but it's not the CL-style debugger
00:43technomancystill pretty awesome though
00:44kwertiitechnomancy: cool, anything would be great
00:45tomojwhat is "hyperdoc"?
00:46tomojoh, I see
00:59psykotictechnomancy: is there any existing java-on-emacs debugging infrastructure to reuse?
01:01remleduffIs there a "send current file to repl key?
01:01remleduff "
01:02kwertiiremleduff: C-C C-k (current buffer), C-C C-L (some file, current one by default)
01:03remleduffThanks
01:03kwertiiI 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?
01:03kwertiiremleduff: sure np
01:05kwertiipsykotic: 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...
01:05psykoticif you mean the GUD, ugh
01:07psykoticanyway, i was more referring to java-specific backend stuff. the GUD is mostly frontend.
01:08hiredmankwertii: pmap/pvalues + reduce
01:12kwertiihiredman: interesting, I'll give that a try, thanks
01:26kwertiihiredman: 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
01:27kwertiibut will try
02:04technomancypsykotic: http://georgejahad.com/clojure/cljdb.html
02:05psykotictechnomancy: nice, thanks
02:05technomancymight be a little outdated
02:32zabHi. 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
02:33hiredmanis that SuperCVS?
02:33zabopencsv: http://opencsv.sourceforge.net/
02:34hiredmanwhat are you expecting it to do?
02:34zabprint out each line in a CSV file
02:34zabin Java, opencsv is typically used like this: while ((nextLine = reader.readNext()) != null) {...
02:34hiredmanfyi nil is boolean false in clojure, and when you evaluate to nil on false it is ideomatic to use when
02:35hiredman(when line ...)
02:35hiredmanand what does it do?
02:35zabreturns a String[], until the while loop is exhausted
02:36zabi.e. there are no more lines in the CSV file to parse
02:36hiredmanno
02:36hiredmanI mean what does your clojure code do when you run it?
02:36zabno output
02:37hiredmanare you sure there should be some?
02:37zabyeah, I have checked and my file is being uploaded, and a new CSVReader is being correctly instantiated.
02:37zabwith the uploaded file
02:37hiredmanI would start adding logging/prns to trace the program
02:38hiredman(doto (.readNext csv-reader) prn)
02:38hiredmanwill prn the result of .readNext and also return it
02:40G0SUBI have a news, Clojurians....
02:40hoeckzab: and split the function in a request-processing and a csv-processing one and a printing one, so can better test them
02:40G0SUB[ANN] There is going to be a Clojure Cookbook.
02:40G0SUBI will put up an website with the info soon.
02:41hoeckG0SUB: nice!
02:41tomojfor chef?
02:41tomojor, like "rails recipes" ?
02:41G0SUBWe will invite recipes from the community. (Recipe authors will get credit in the book)
02:41zabhiredman, hoeck: okay :)
02:41tomojawesome
02:41G0SUBtomoj, on the lines of Perl Cookbook. but not by O'Reilly.
02:41hiredmanthe loop there looks ok
02:42hiredmanso start printing to check and see the data flowing through is what you expect
02:42hoeckG0SUB: short things like (->> (CSVReader. <args>) (iterate #(.readNext %)) (take-while identity) doall) ?
02:42hoeckG0SUB: or more complete/bigger solutions?
02:42G0SUBhoeck, those, and some more involved things too.
02:42G0SUBhoeck, recipes encompassing all levels.
02:43G0SUBhoeck, covering the most common things that people would want to achieve with Clojure.
02:43hoeckG0SUB: I'd like to see/write sth. on macro-writing macros!
02:44G0SUBhoeck, sure. I will announce the website and other details when the contract has been signed. give me a week or two.
02:44zabhiredman: http://paste.lisp.org/display/96318 prints #<String[] [Ljava.lang.String;@3bfe8b7c>
02:45zabhiredman: So I am fairly sure the only thing wrong with my code is my loop/recur.
02:45hiredmanzab: don't change the code!
02:45hiredmanjust add print statements
02:45hiredmanlike (loop [ … ] (prn line) … )
02:46zabhiredman: k
02:49zabthe condition (if (= line nil) is always satisfied
02:50hiredmanso .readNext always returns nil?
02:51zabSeems like it. But I don't have confidence in the way I've defined the loop. First one I've written. ;)
02:52hiredmanwell it looks sound
02:52hiredmanthe problem appears to be with your vsc file
02:52hiredmancsv
02:52hiredmanor, not the file, but before you enter the loop
02:53hiredman(doto (:tempfile (:form-csv-upload (:multipart-params request))) prn)
02:54hiredmanactually
02:54hiredman(doto (:tempfile (:form-csv-upload (:multipart-params request))) (-> .exists prn))
02:55zabboth gave me the same output, complete dump of the CSV file
02:55hiredmanwhat do you mean both?
02:55zabthe 2 lines you provided
02:55hiredmanand you whould not see the output of those lines, just what they print
02:56hiredmanand the second like will just print true/false
02:56hiredmanunless you aren't actually putting them into the fn
02:56hiredmanwhich means you are not really debugging the fn
02:58zabthis: http://paste.lisp.org/display/96319 dumps the CSV file
03:00hiredmanhttp://paste.lisp.org/display/96317#1
03:00hiredman 23:46 hiredman : zab: don't change the code!
03:01hiredmanthat will dump the file, and it is not what I asked you to do, do you want help or not?
03:02zabi didn't understand what you meant
03:05hiredmanthe parens are not balanced correctly in the annotation I made
03:05hiredmansorry
03:05zabYeah that's okay. I'm trying to fix it up. V new to Clojure.
03:08zabI get no output. Expected?
03:10hiredmanno
03:12hiredmanhttp://paste.lisp.org/display/96317#2 try this
03:13hiredmanis should print out :enter, a boolean, some kind of map, and then maybe :loop
03:14zabno output
03:14hiredmanhow are you running this? obviously through compojure somehow, but how are you starting compojure
03:14zabthrough nailgun/vimclojure
03:15hiredmanzab: so whatever you are doing that you thing you are changing the definition of this function is not actually changing it
03:15hiredmans/thing/think/
03:15hiredmanwell
03:16hiredmanpossibly it's an issue with *out* though
03:16hiredmanhow are you starting nailgun?
03:17zabthrough an ant script. works well.
03:17hiredmanant may be eating prints
03:18hiredmanwhat happens if you just eval (.println System/out "test")
03:19hiredmando you see anything in the terminal where you ran/are running ant
03:19hiredmanor even in vimclojure's repl buffer
03:20zabnothing from terminal where ant is running. vimclojure's repl buffer returns output: test and nil
03:20hiredmanwell that's good, I guess
03:20hiredmanhow are you re-defing the function?
03:21zabrecompiling in vimclojure with \ef, and then refreshing my browser to see new output
03:21hiredmanhmmm
03:22hiredmancan you restart everything easily?
03:23zabyep.
03:23hiredmanor I should say, restart compojure
03:23zabyep I just did. I just restarted my whole environment.
03:23hiredmanok, and?
03:23zabsame :(
03:23hiredmanwhere are you calling this function from?
03:24hiredmanoh!
03:24hiredmanare you calling this directly from the defroutes form?
03:24zabI've defined routes via compojure's defroutes
03:24zabheh yes
03:24hiredmanbah
03:24hiredmannevermind
03:25hiredmanwell, put a (do (println :foo) process-uploaded-csv
03:25hiredman)
03:25hiredmanin place of process-uploaded-csv
03:25hiredmanmake sure that route is getting called
03:27zabno output from: http://paste.lisp.org/+22BH/3
03:27hiredmancan you post the build.xml?
03:28tomojwhat's the response?
03:28zabtomoj: blank
03:28hiredmanthat is odd
03:29hiredmando you have a trailing '/' in the url in your browser?
03:29hiredmanwell no, that should get an exception, not blank
03:29zabno. 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
03:29zabfor app engine
03:30hiredmanah
03:30hiredmanthat might be why the prn stuff is not working
03:30zabapologies
03:30hiredmanI forget if the local devserver pass that or not
03:32hiredman(defmacro log [string] `(.info (Logger/getLogger "global") ~string))
03:32hiredmanput that right after your (ns …)
03:33hiredmanwell, put a (do (log "foo") process-uploaded-csv
03:33hiredman)
03:33hiredmanuh, edit and change the (println :foo) to (log "foo")
03:36zabwhere is this log output supposed to go?
03:37hiredmanstdout or stderr
03:37hiredmaneither the repl buffer or the terminal with ant
03:38hiredmando you have all those pesky appengine xml files setup?
03:38zabyep
03:39hiredmanand a basic helloworld page works?
03:39zabyep
03:39hiredmanare you sure?
03:39hiredmanoh
03:39hiredmanhell
03:39hiredmanI was thinking about this earlier
03:39hiredmanbtw the multipart stuff compojure uses is not allowed on appengine
03:39zabyeah. I've got an enlive page that is a html form, which is what I use to POST the CSV file.
03:40zabthe enlive page is served correctly and it uploads the file fine
03:40hiredmanyou won't be able to upload anything that uses the multipart stuff to appengine
03:41zabI changed apache commons-fileupload package to make it work on GAE.
03:42zabthe 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.
03:43hiredmanok
03:43zabalso, I don't think vimclojure shows output in its repl.
03:43hiredmanare you recompiling before restarting the dev server?
03:43zabwell it doesn't show output from the jetty server it runs anyway
03:43zabyeah
03:44hiredmanwhat happens if you just put (println :foo) in the middle of the file?
03:44zaband I think you're right in that ant is eating stdout/stderr
03:45hiredmangah
03:45hiredmanit might not eat stderr
03:46zab(println :foo) nothing happens.
03:46hiredman(.println System/err "foo") somewhere in your file
03:47hiredmanor (binding [*out* *err*] (println "foo"))
03:47zabnothing. I think it is ant.
03:47zabi will investigate
03:47hiredmanthe sdk comes with a shell script for starting the server
04:42zabhiredman: thanks for your help. I'm logging off for now. It's GAE who is eating the stderr/stdout output.
06:04dcnstrct(.length (byte-array 2)) <-- why doesn't that work ?
06:05dcnstrctahh ok.. (alength (byte-array 2)) works
06:05dcnstrctshouldn't both of those work though in theory ?
06:37raekdcnstrct: I think (but I could be wrong) that .length is special java syntax for arrays
06:37raekand that the bytecode for a .length method call for an ordinary object is not the same as the .length for arrays
06:46dcnstrctoh that's right... I forgot in Java everything is not an object
06:46dcnstrctthere are all these special cases like that
06:46dcnstrctor rather.. some things are not objects..
06:46dcnstrctheh
06:50LauJensenI'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 ?
06:52LauJensen(not CL specific, same goes for new-comers to Clojure)
06:52RaynesLisp wasn't more complicated than anything else to me.
06:53RaynesIt was OOP that took me a while to wrap my mind around.
06:53LauJensenThats almost the complete opposite of everyone else I think
06:54RaynesMostly 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.
06:54Raynes"This is sending a message to that on this for that."
06:54Rayneswut
06:55RaynesFirst, 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.
06:55LauJensenI 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
06:55RaynesHoly hell, it's daylight.
06:56RaynesUh oh.
06:56RaynesDaylight savings time.
06:56LauJensenBut comfortably reading Lisp was as easy for you as C et al ?
06:57RaynesI've never really used curly bracket languages.
06:57Raynes/discussion
06:58LauJensenaha
06:58LauJensenThat might atually explain the ease of entruy
06:59LauJensenDisregarding the 'u'
06:59RaynesI've played with Scala, but the whole "You have to explicitly mention the types of arguments." stuff irked me.
06:59LauJensenScala has very good type inference
07:00RaynesIndeed, but having to explicitly type argument types makes my eyes bleed.
07:00RaynesAnd my fingers shiver.
07:01LauJensenBut I don't think you HAVE to
07:04dcnstrctlanguages 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.
07:04RaynesLauJensen: What was the last message you got from me?
07:05SynrG08:00 < Raynes> And my fingers shiver.
07:05RaynesThanks.
07:06dcnstrctRuby is a trojan horse to get lisp inside the curley bracket programmer's head.
07:06Rayneshttp://gist.github.com/331289
07:06LauJensen I dont understand why people claim that Ruby has the full Lisp chainsaw - Where's the connection ?
07:06RaynesI'm with Mister Jensen.
07:07dcnstrctwell with Ruby you can add extensions to the language easily.. to create DSLs are almost macros
07:07Raynes"almost"
07:07dcnstrctok not easily.. and not extensions to the lnaguage... but stuff that kind of feels like it
07:07noidiI don't get it either... it's quite a jump from a language.like.api() to macros
07:07LauJensenHow so ? Its not homoiconic, it doesnt control evaluation, wheres the connection ?
07:07LauJensenMost of these 'macros' look like nothing more than regex tricks
07:08LauJensen( I might be wrong, I'm not a Rubist, so these are honest questions )
07:08eevarRaynes, Scala does type inference, though? so you don't have to add type declarations?
07:08Rayneseevar: You have to explicitly declare the types of function arguments.
07:09LauJensenRaynes: Im not sure thats the case anymore
07:09RaynesIt certainly was like 6 months ago.
07:09eevarokies. I decided going for haskell was more worthwhile than learning scala
07:09eevarso don't have any scala experience at all
07:09dcnstrctyou can add methods to your objects at runtime in Ruby that can give you marco like functionality
07:10RaynesHaskell is probably more worth learning than most any other language.
07:10RaynesIf anything can teach you how to program functionally, and smack you around if you fail, Haskell is it.
07:10LauJensendcnstrct: I think thats a stretch- A _huge_ stretch
07:10LauJensenAnyway - back to the thinking box
07:11G0SUBLauJensen, it's mostly some specific syntactic sugar to assist in metaprogramming.
07:11LauJensenG0SUB: Where on the other hand, Macros _are_ metaprogramming you mean ?
07:12dcnstrctmacros 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.
07:12G0SUBLauJensen, according to Ruby guys, macros are not the only way to do metaprogramming
07:12G0SUBdcnstrct, +1
07:12LauJensendcnstrct: Curly braces are catching up- There's a lot of talk of metaprogramming in C# I think
07:12G0SUBLauJensen, make no mistake, Ruby has very limited MP support.
07:13dcnstrctyeah they're all trying to catch up.. java has annotations now to try to get some of the same..
07:13dcnstrctRuby has the best meta-programming support of any curley bracket language I think
07:13dcnstrctbut it's still piss poor compared to a lisp
07:13LauJensenOk - So still no idea where this "full lisp chainsaw" talk is from ?
07:14Raynes"full lisp chainsaw, without the chain and fuel"
07:15LauJensenhehe
07:15G0SUBRaynes, and the saw
07:15LauJensenHAHA
07:15Raynes;)
07:15G0SUBthat'd be more appropriate
07:15G0SUBLauJensen, http://ruby-metaprogramming.rubylearning.com/
07:15dcnstrcthttp://www.randomhacks.net/articles/2005/12/03/why-ruby-is-an-acceptable-lisp
07:16RaynesI signed up for the rubylearning Clojure course.
07:16dcnstrctlol @ lisp chainsaw
07:16G0SUBRaynes, cool. I hope the course proves to be useful
07:16G0SUBLauJensen, http://ruby-metaprogramming.rubylearning.com/
07:17dcnstrctclass Order < ActiveRecord::Base belongs_to :customer has_many :items, :dependent => true
07:17RaynesI hope I can prove to be useful.
07:17RaynesI mainly signed up to help others.
07:17dcnstrctoops didn't mean to passe that last part
07:17LauJensendcnstrct: That article makes a lot of sense considering its from 2005
07:18LauJensen"Lisp hasn't gone anywhere in 20 years and has no libraries" - If only he would have waited 1 year :)
07:18dcnstrcthahaha
07:18G0SUBRaynes, FYI, I am a teacher of the course :)
07:19RaynesG0SUB: Oh, cool.
07:19G0SUBRaynes, you can help us in creating excercises.
07:19RaynesI'm a teacher as well. I'm just undercover as a student. s_s
07:19Raynes:p
07:19G0SUBRaynes, I will let you know...
07:20RaynesWhich teacher are you?
07:20G0SUBRaynes, Baishampayan Ghose
07:20RaynesThat's a mouth full.
07:20G0SUByes
07:21G0SUBRaynes, call me BG or G0SUB :)
07:21Raynes:)
07:21RaynesAre the lessons going to be screencasts or something?
07:22G0SUBRaynes, not at this stage...
07:22RaynesGood.
07:22RaynesI don't have the bandwidth for screencasts.
07:23LauJensenG0SUB: Oh youre Baishampayan Ghose - Is there a special story behind that name ?
07:23G0SUBLauJensen, it's an Indian name.
07:23RaynesI keep wanting to pronounce his last name as goose.
07:23LauJensenHehe
07:23G0SUBLauJensen, Ghose is a common surname.
07:23LauJensenI read it as "Bayesian Goose" as well
07:23LauJensenAh ok - Just wondering, hope you dont mind me asking, but India is a long way from Denmar
07:23LauJensenk
07:23G0SUBLauJensen, some people have called me Bon Goose.
07:24G0SUBLauJensen, indeed, it is. it's near China
07:24LauJensenIf I were you, I might consider changing name to "Rich Hickey", that could give you a lot of business in India ;)
07:25G0SUBLauJensen, I would doubt that. not many people know about Clojure in India. and anyway, I am not qualified enough to be called Rich Hickey.
07:25RaynesYou aren't qualified to be called a Goose either, but...
07:25G0SUBRaynes, indeed.
07:26G0SUBI can't fly/
07:26RaynesG0SUB: I'm Anthony Simpson on rubylearning, in case you were wondering.
07:26LauJensenI saw a sign from India the other day, "Michaels Soft Twindows" or something like that - only reason I mentioned it
07:26RaynesI'm not related to Homer, Jessica, et al.
07:26G0SUBRaynes, I see. :)
07:26G0SUBLauJensen, where did you see it?
07:27SynrGah, i'm enrolled in the course, too
07:28LauJensenDont remember
07:29SynrGBen Armstrong. the guy who wants to run clojure on OpenVMS.
07:29SynrGincidentally, what sorts of issues might I expect using java5?
07:29SynrGunfortunately, HP only makes java6 for VMS/Itanium and our primary dev system (and all of our clients) is VMS/Alpha
07:30SynrGfor which there is only java5
07:30danishkireltest
07:30RaynesLauJensen: Didn't you say you were playing with J or something?
07:30LauJensenI <3 J
07:30RaynesIt looks awesome.
07:30hiredmanSynrG: clojure runs on 5 fine
07:30LauJensenIt is
07:31RaynesUseful for anything?
07:31LauJensen(if only they would add the option for inifinite seqs)
07:31SynrGhiredman: my initial tests said so, anyway. but i haven't done anything real with the language
07:31LauJensenRaynes: 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
07:31SynrGi was even playing with nailgun on VMS and that seemed to work
07:32LauJensenWriting 'real' software in J would probably be incredible painful
07:32hiredmanthat being said I've seen one or two reports of speed ups from moving to java6
07:32etatesome1 would like to try my uber color-theme?
07:32dcnstrctI would
07:32dcnstrctemacs ?
07:32etateye
07:32RaynesI'll try it.
07:32dcnstrcthook it up I was just getting tired of mine
07:33etatehttp://gist.github.com/331058
07:33RaynesLauJensen: Haha @ Dong Energy
07:33LauJensenHehe
07:33LauJensenRaynes: Its a _huge_ company, I dunno why they picked that name
07:33LauJensenetate: screenshot?
07:34etateLauJensen oka, where is an easy paste for screens?
07:34Raynesetate: tinypic
07:34LauJensenetate: nvm, I just ran the code - I was being too lazy
07:34LauJensenIt looks good
07:35LauJensenI think I'll stick with charcoal-black, but its better than the majority of the themes out there :)
07:35dcnstrctSymbol's function definition is void: color-theme-install
07:35dcnstrctweird
07:36LauJensendcnstrct: just paste the code in ielm
07:36Raynesetate: Looks good. I like dark themes though. I use hober.
07:36etateLauJensen: thanks, my first attempt :)
07:37dcnstrctyeah I did.. then did M-x eval-buffer
07:37LauJensennice
07:37dcnstrctoh well
07:37RaynesLauJensen: Charcoal black sucks.
07:37Raynes:p
07:37etateRaynes: my theme is not dark? :)
07:37etateRaynes: you mean the colours are bright in the text?
07:38Raynesetate: I mean dark as in black.
07:38RaynesOr close to black.
07:38etateRaynes: ah, actually this theme started closer to black, i will show you the original sec
07:38RaynesI think I'm going to switch to vibrant-ink for a while, see how my eyes work out with it.
07:39noidihttp://brockman.se/2003/zenburn/zenburn.el http://slinky.imukuppi.org/zenburn/zenburn.png
07:39noidi:)
07:39etateRaynes: http://gist.github.com/331299
07:40etatenoidi: nice theme :)
07:41RaynesCute.
07:42RaynesIt's easy on the eyes.
07:46raekis it a bad practice to let namespace foo.bar use foo?
07:47raekor should dependencies only be "downwards" in the ns hierarchy?
07:47noidiI'd put the stuff that the sub-namespaces use into foo.util or something
07:48hiredmanand you shouldn't have a foo
07:48RaynesI'm disoriented.
07:48RaynesI'm not sure what time it is.
07:49hiredmansingle segment namespaces can raise issues with compilation
07:49noidiRaynes, 14:49 ;)
07:50raekyes, I just was too lazy to make up more parts of the namespace
07:50raeks/foo/x.y.foo/
07:50raekanyway, I want to define a multimethod in x.y.foo
07:51raekand separate the different implementations into different files
07:51hiredmanI don't see why not, just watch out for circular dependencies
07:52raekok, thanks!
07:52noidiin that case I think referring "upwards" is fine
08:03pdkit involves a hula hoop and absinthe
08:03RaynesIoke needs good random numbers.
08:04LauJensenQuick, while nobodys talking Clojure, this video http://flattr.com/beta/ <-- Which type of software makes making one of those easy ?
08:05noidiI'm currently reading On Lisp, and I'm amazed at how much nicer Clojure is than Common Lisp
08:06noidinot only am I learning Lisp, I'm also learning to appreciate all the nice things in Clojure that I took for granted before :)
08:07esjLau : that's an interesting idea
08:07noidiespecially how Clojure deals with variable capture and gensyms in macros
08:09LauJensenI think I'm going back to ERC now
08:09RaynesI can't force myself to configure ERC.
08:10LauJensenWell I'm past that
08:10LauJensenIf only I could implement Thunderbird in Emacs, I'd never have to leave
08:10etateRaynes: i've just created a new theme based on a darker palette if you want to see :D
08:11RaynesSure.
08:12etatehttp://gist.github.com/331310
08:12RaynesHoly shit. I just crashed the Java VM.
08:12Rayneshttp://gist.github.com/331311
08:13etatelibc :(
08:13Raynesetate: That looks very good.
08:14RaynesI'm not sure what caused that.
08:14RaynesIt scares me.
08:14etateRaynes: thanks, i havent used it for anything but clojure code yet though so dunno how it looks in other langs
08:14etateRaynes: hmm that looks like a Java function too, scary
08:14RaynesIt is a Java function.
08:15RaynesOh.
08:15RaynesI don't think it's static.
08:15RaynesBut I also don't think crashing the VM is a good way to let me know that it isn't static. :o
08:15RaynesYep.
08:15RaynesThat was it.
08:15Raynes:o
08:16etateRaynes: man i must have crashed the JVM about 100 times yesterday
08:16RaynesIt's not crashing it now. Not sure what went wrong.
08:17LauJensenYou got a core dump when it happens Raynes
08:17RaynesI don't want to know.
08:17RaynesI'm mortified.
08:18Raynes(doc rand-int)
08:18clojurebot"([n]); Returns a random integer between 0 (inclusive) and n (exclusive)."
08:19LauJensenI see I've deleted my old .emacs with the ERC setup... Raynes help
08:19LauJensen:)
08:20RaynesI don't have an ERC setup.
08:20RaynesI don't use it.
08:23LauJensen~ping
08:23clojurebotPONG!
08:24Raynes~pong
08:24clojurebotPONG YANG!
08:26LauJensenHmm, hooking ERC highlighting directly into libnotify, sweet :)
08:27RaynesI think that is why I never used ERC. I couldn't figure out how to get name highlighting working or something.
08:27LauJensenhehe
08:28LauJensenYoure a strange guy Raynes, you learn Lisp without much difficulty, yet you stumple when setting up nick highlighting :)
08:28RaynesI know, I know. :p
08:48etateman, clojure is making me like the jvm more and more
08:49LauJensenetate: It really has that effect on people
08:51etateLauJensen: I used to use CL for pretty much all my code but I'm seriously considering switching, and dealing with the learning curve
08:52LauJensenetate: If you're serious about writing quality code, I recommend switching sooner than later
08:54etateLauJensen: 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. :)
08:55LauJensenIndeed
08:55LauJensenAnd also these super powerful core datatypes, which all implement the same interfaces and are all immutable is the gift that keeps on giving :)
08:58etateLauJensen: yeah i think thats actually one of the best things in clojure, generic sequences, and the ability to add your own
08:59etateLauJensen: but the way it interoperates with Java is great too
09:00etateseems like great decisions were made in the design... like the addition of maps etc, and destructuring on them in lets is just great
09:01etatethe only thing i'm missing at the moment is proper clojure indentation in emacs
09:25LauJensenWasn't there a link to color-theme-bliss in here? Somebody plz paste
09:33etateLauJensen: i just made a new one that is darker, the one i'm currently using, wanna see?
09:34etateLauJensen: dark-bliss: http://gist.github.com/331310
09:34LauJensenetate: 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 ?
09:35LauJensenCan you paste the first one again please?
09:35etateLauJensen: yeah its the one i wrote: http://gist.github.com/331038
09:35LauJensenThats not the one I'm thinking of though
09:36LauJensenFound it - Its the dark one
09:36etateLauJensen: dark-bliss ? :)
09:36LauJensenThe problem is that its broken, so you cant load the dark one, without loading the standard version first, can you fix that ?
09:37LauJensenRaynes: I've now made a ERC config which works with Ubuntus libnotify for highlighting, will you start using if I blog about it ? :)
09:37etateLauJensen: if you restart emacs and then load the dark theme it works i think?
09:37LauJensenLemme try
09:38etateLauJensen: if you use multiple color-themes it sometimes messes up, i think its a color-theme problem
09:38LauJensen(color-theme-dark-bliss)
09:38LauJensen*** Eval error *** Wrong type argument: listp, color-theme-bliss
09:38RaynesLauJensen: Probably.
09:39etateLauJensen: I put the defun after (require 'color-theme) in emacs, then i just do M-x color-theme-dark-bliss
09:39LauJensenNo dice
09:40etateLauJensen: 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)
09:40LauJensene23, no ide aRE c-t
09:41etateLauJensen: oh thats because i made a mistake in the code, my bad
09:41etateLauJensen: i'll paste the fixed version
09:41LauJensenFantastic - I've found a new color-theme ! Thanks a ton!
09:42etateLauJensen: http://gist.github.com/331346
09:42etate:) no worries, i wanted to try my hand at making one was getting tired of calm-forest & charcoal-black hehe
09:43LauJensenThis is by far my favorite
09:43pjackson /join #startups
09:43pjacksonoops
09:44etateLauJensen: cool, i'll make more in the future then :D
09:44CloudiDustGreetings #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?
09:47LauJensenetate: I've put it in clojure-theme-library but the symbol isn't evaluated when parsing .emacs, any idea why ?
09:50etateLauJensen: hmm the defun isn't evaluated?
09:51LauJensenNope
09:51LauJensenBut the rest of the library themes are
09:51etateLauJensen: 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
09:52etatestandard libraries should be standard themes
09:52LauJensenAh ok
09:52LauJensennp
09:52etateLauJensen: i'll look into it for next time :)
09:54LauJensenThis is great - ERC/libnotify integration and a shiny new color-theme all in the same hour
09:57etate:D
09:57etateanyone have any idea why when i compile my SWT app it all seems to run but no window displays?
09:58LauJensenetate: I'm guessing it has to do with your code
09:59etateLauJensen: 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:04etatein case anyone knows: http://paste.lisp.org/display/96330
10:41LauJensen~ Lau?
10:41clojurebotNo entiendo
11:37technomancyLauJensen: can you paste your erc/libnotify elisp?
11:38LauJensen~paste
11:38clojurebotlisppaste8, url
11:38LauJensentechnomancy: no sorry :)
11:38technomancylisppaste8 isn't registered =\
11:39technomancyscpaste never lets me down. =) (http://p.hagelb.org)
11:39LauJensenaaaah
11:40LauJensenI really like Gist integration in Emacs
11:40technomancythat's pretty good too
11:40technomancybut more moving parts means more can go wrong
11:40technomancygist is more reliable than pastie was though
11:40LauJensenhttp://paste.lisp.org/display/96331
11:41LauJensen(I admit, I'm no elisp coder)
11:41technomancycool, thanks
11:41technomancyok, say my name so I can test?
11:42LauJensentechnomancy: testing
11:42technomancycool; works nicely
11:42LauJensenexcellent
11:42technomancythough I don't have emacs.svg in that location
11:45technomancyfound it... that's quite nice
11:49LauJensenOh I actually thought that was standard
11:49LauJensenI'll strip it in case I blog about it
11:50technomancyit's probably standard if you install from apt
11:50technomancyrather than from source
11:52LauJensenStill - Absolute paths are regrettable
12:06LauJensentechnomancy: 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:12technomancyaha
12:57etatecan you create abstract java classes in clojure?
13:01underdevi 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:01underdevexpand macro, etc
13:09vyunderdev: It's implemented within swank protocol, Clojure supplies that value to SLIME.
13:09LauJensenunderdev: If your jars contain the source, this should work out of the box
13:10etatesome Java functionality has to be gen-classed before it can be used right?
13:10underdevvy, LauJensen: ty
13:10vyunderdev: See find-definitions-for-emacs in src/main/clojure/swank/commands/basic.clj:313
13:13underdevvy: thank you
14:03etatewhilst using gen-class, is there way to name your files hello-world instead of having to do hello_world ?
14:04StartsWithKetate, use java convention for class names
14:04StartsWithKns1.ns2.HelloWorld
14:05etateStartsWithK: okay
14:23joshua-choiMy gosh, I've finally found the source of a strange bug
14:23joshua-choi(= [1 2] (list 1 2))
14:24joshua-choiThat 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:24joshua-choiUgh
14:25joshua-choiIs there a way to test for equality for Clojure vectors and lists that includes type equality?
14:26chouserthere are more than one kind of vector, and more than one kind of thing that looks like a list
14:26chouserhow specific do you want your type equality to be?
14:27vychouser: More than one kind of thing that looks like a list? Like what?
14:28chouser,(cons 1 nil)
14:28clojurebot(1)
14:28chouser(list 1)
14:28chouser,(list 1)
14:28clojurebot(1)
14:28chouser,(map type [(cons 1 nil) (list 1)])
14:28clojurebot(clojure.lang.PersistentList clojure.lang.PersistentList)
14:28chouserd'oh
14:28StartsWithK, (= (list 1 2) (doto (java.util.ArrayList.) (.add 1) (.add 2)))
14:28clojurebottrue
14:28vyjoshua-choi: Maybe: (= (seq [1 2]) (list 1 2))
14:28chouser,(map type [(cons 1 '(2 3)) (list 1 2 3)])
14:28clojurebot(clojure.lang.Cons clojure.lang.PersistentList)
14:29chouser,[(cons 1 '(2 3)) (list 1 2 3)]
14:29clojurebot[(1 2 3) (1 2 3)]
14:29vychouser: but
14:29vy,(= (cons 1 '(2 3)) (list 1 2 3))
14:29clojurebottrue
14:29joshua-choichouser: 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:30joshua-choiIt creates very subtle, stateful bugs depending on if you call (f [1 2]) or (f (list 1 2)) first.
14:30joshua-choiI have no idea what to do, other than stopping memoizing
14:30chouservy: exactly
14:31vyjoshua-choi: Writing a wrapper function that calls "seq" over its argument can be an option.
14:31chouserbut he doesn't *want* [1 2] to be treated the same as (1 2)
14:32vyDoesn't he? Oh, sorry then.
14:32chouserjoshua-choi: my point is that you haven't yet specified the behavior you want instead
14:32chousershould (cons 1 '(1 2)) be treated the same as (list 1 2 3)?
14:32LauJensenjoshua-choi: How about adding type-checking to memoize?
14:33joshua-choiLet'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:33joshua-choiWhy would I need to memoize constantly? It's just a stand-in for a more complex function-returning function.
14:33joshua-choiWhy do I need to distinguish between lists and vectors? I'm writing a Clojure-in-Clojure parser, so it matters.
14:34joshua-choiI'm not sure what to do. :(
14:34chouserso do you want (cons 1 '(1 2)) be treated the same as (list 1 2 3) or not?
14:34chousershould each of them be treated the same as (range 3) or not?
14:35joshua-choiI'm not sure. Well, let's find out:
14:35joshua-choi,(eval (cons 1 '(2 3)))
14:35clojurebotDENIED
14:36joshua-choiOh, dang.
14:36joshua-choiGood, it works in my REPL.
14:36joshua-choiYes, I'm not distinguishing between cons-cells and lists, but I am distinguishing between lists/cons-cells and vectors.
14:37joshua-choiThis is the same behavior of the standard eval function.
14:39joshua-choiWell, 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:40joshua-choiI've got to go; I wonder if I should roll my own memoize function...
14:40chouseryou may have to write your own memoize, which is really not very hard
14:40joshua-choiYeah, you're right about that. :)
14:42chouserhehe
14:42chouser(eval ['do 1]) ;=> 1
14:44defnwhat are the new super fancy changes to swank-clojure?
14:44defnim dying to know
14:47defnwhen im using -'
14:48defnerr, 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:51underdevspeaking 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:56underdevdo i just M-x slime manually? the error seems to have gone away...
14:57underdevafter manually starting slime
15:00The-Kennyunderdev: If it hangs, take a look at the *inferior lisp* buffer
15:01The-KennyThere's the output of clojure before slime is started
15:01underdevThe-Kenny: okay! ty
15:01underdevmaybe i can figure it out from here...
15:02The-KennyMaybe you forgot to add swank-clojure to the dependencies of the project
15:02remleduffunderdev: Do you have swank-clojure in your deps
15:02underdevyepper
15:02underdevthat's it
15:02remleduffBah, The-Kenny beat me
15:02The-Kenny(:dev-dependencies [[swank-clojure "1.1.0"]])
15:02underdevthanks guyd
15:02underdevguys*
15:02remleduffI had the same problem yesterday :)
15:02remleduffTook a while to figure out because swank-clojure doesn't come up when you search on clojars
15:07underdevw00t!
15:09underdevomg so cool!
15:17LauJensenunderdev: ex rubyist?
15:18underdeva little rails. mostly tcl.
15:18underdevw/ vim
15:20LauJensenk
15:20giaceccoLau: hi, I've developed in Ruby until a couple of years ago
15:22LauJensenk :)
15:22underdevi 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:23LauJensenYea so.. If you guys want to talk Ruby I suggest you log off the internet :)
15:23giaceccoI still like Ruby a lot, but I got to an age when I need something different than traditional procedural languages
15:23hiredmanan age?
15:23giaceccoalmost 40
15:24giaceccoI 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:25underdevI 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:26giaceccoit'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:26LauJensenWhich two, Ruby and Clojure?
15:27giaceccoy
15:27LauJensenNo I'd say they are almost as different as 2 languages can get
15:27underdev(ruby includes tcl for access to tk... and i will shut up about it now
15:29giaceccoLau: ok, I wasn't wrong then
15:29giacecconeed to leave guys, I'll be back
15:29Rayneshiredman: ping
15:29LauJensenc u :)
15:30defnruby and clojure have some similarities
15:30RaynesYep. Like cup and pond have some similarities.
15:31defnbut i dont think it's useful to think about them
15:31defnRaynes: im just saying -- they arent exact opposites -- there is some love for lisp in ruby
15:32raekas long as you only use one lambda... ;)
15:32defnheh
15:33defnthere's no fight here
15:34defni 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:36chouser@x = @x + 1 # uncontrolled mutation of instance member!!
15:37defn:)
15:37underdevsyntax... meh
15:37arohnerruby has about as much love for lisp as java does for smalltalk
15:39raekone thing I love clojure got right from the beginning (thanks to java getting it right) is the distinction of bytes and characters
15:39defnyou get some macro functionality in ruby, you get a bunch of functional methods
15:45defni need an efficient way to tag lists and then search those tags
15:48underdevdefn: make the lists the values of a map, and the tags the keys?
16:03hiredmanRaynes: pong
16:03RaynesHow did you manage to set clojurebot's name?
16:04RaynessetName is protected, and you can't create your own constructors with proxy.
16:04hiredmanhttp://github.com/hiredman/clojurebot/blob/master/src/hiredman/clojurebot/core.clj#L410
16:05RaynesOooh. Hax.
16:05ChousukeI like the name
16:06hiredmanit was in contrib, but I think it got renamed recently
16:06RaynesIt's a cute little hack.
16:06RaynesAnd useful.
16:07hiredmanpircbot also has a changeNick method
16:07RaynesOf course it does.
16:07hiredmanbut you cannot call it until you are already connected to the server
16:08hiredmanso the utility is limited
16:08RaynesOh.
16:14etatedid you guys check out my latest colour-theme btw?
16:18Fossihaxhax
16:18Fossireflectionism
16:20Fossii bet you can wreak havok with that
16:28LauJensenWhere do I find that IntelliJ Clojure plugin ?
16:29Apage43It's "La Clojure"
16:29Apage43http://plugins.intellij.net/plugin/?id=4050
16:32LauJensenThanks
17:23dcnstrcthi. 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:25dcnstrctbegin; something_that_throws(); rescue FooException, BarException, BazException; some_behavior; end
17:25dcnstrctthat's how it would be done in Ruby
17:29arohnerdcnstrct: you can use two catch statements, or write a macro
17:29dakronedcnstrct: I believe you can have 2 catch statements
17:30dakrone,(try (/ 1 0) (catch FileNotFoundException _ (println "foo")) (catch Exception _ (println "bar")))
17:30clojurebotdakrone: Excuse me?
17:30Fossiis there a way to AOT compile all gen-classes without naming them?
17:30dcnstrctI wanted to print foo both time so I was hoping to not have to duplicate the: println "foo"
17:31dcnstrctI like the macro idea.. because I'm going to be using this in several places
17:31dcnstrctthnx
17:31Fossiwith-logged-exception
17:53Fossican you gen-class abstract classes?
18:01Fossihmmm. maybe i'm really "doing it wrong" (tm)
18:02sramsayTrying to run Volkmann's snake.clj, and it's giving me an EOF error.
18:02sramsayclojure and contrib 1.1.0
18:03sramsayCan't see anything wrong with the file . . .
18:04sramsayAnyone know what "EOF while reading (snake.clj:259)" means?
18:04sramsay259 being the last line.
18:05ska2342sramsay: missing closing paren, missing end-of-string-quote.. sth like that probably
18:05sramsayYeah, but I've been all over the code looking for unbalance parens.
18:05sramsayCan't see it.
18:05sramsayDoes clojure have a syntax checker?
18:06ska2342sramsay: where's the file?
18:06sramsayhttp://java.ociweb.com/mark/programming/ClojureSnake.html
18:07Fossiemacs got one. it's called paredit ;p
18:08ska2342sramsay: it compiles just fine over here.
18:08sramsayska2342: What OS?
18:09dcnstrctb
18:09dcnstrcterr
18:09sramsayI'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:09clojurebotclojure euler is http://clojure-euler.wikispaces.com/
18:09sramsayIs that part of my problem?
18:09ska2342sramsay: osx (bless me) but that should not be relevant. Your problem is with the reader.
18:10ska2342sramsay: I'd say you accidentally erased a char or missed one while copying
18:10sramsayk. I'll try it again, then.
18:11sramsaythx.
18:19hiredmanther is a &lt; in the middle of the source
18:20hiredmanat least two, maybe more
18:21ska2342hiredman: in same-or-adjacent-cell? ?. Seems to depend on the browser, for me those two are displayed (and copied) as <
18:22sramsayhiredman: Yeah, I can't see that in my source. It really looks clean.
18:22hiredmanI changed them to > and the eof exception went away
18:22sramsayhiredman: It does seem like the reader is bothered by the encoding, somehow.
18:23hiredmanjava on mac defaults to some silly mac encoding
18:23hiredmanMac Roman
18:23hiredmanbut I doubt that is the problem
18:23clojurebot"There is no problem in computer programming which cannot be solved by an added level of indirection." -- Dr Maurice Wilkes
18:23hiredmanclojurebot: thanks!
18:23clojurebotPardon?
18:24hiredmanso I did view source on the webpage and copied the code from their
18:24hiredmanthere
18:24hiredmanhe really should have a link to the file
18:24sramsayI tried wget (and remove HTML), and then c&p into bbedit.
18:24hiredmanand his use of if at the end instead of when is really not good style
18:25ska2342sramsay: I marked, copied into emacs and saved. Ah, emacs... ever dealt with strange chars and checked C-u C-x = ?
18:27ska2342hiredman: 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:28sramsayhiredman: Yeah, that part is confusing me (I'm a clojure newbie).
18:28hiredmansure
18:28hiredmanyou have to add an argument
18:28hiredman… snake.clj foo
18:28sramsayhiredman: Though not a newbie to osx, lisp, unix, or this kind of irritating problem ;)
18:28hiredmanit looks like this is kind of bitrotted
18:29ska2342hiredman: as the comment says .. earlier versions seem to have left the path over there.
18:29sramsayhiredman: Actually, I tried that foo thing too! trying again . . .
18:30hiredmanit worked for me
18:30sramsayMaking progress! Now starts and quits without error. Also, without opening a window. :P
18:30hiredmanbut the game seems to run by itsself, always to the same conclusion in an infinite loop
18:31ska2342I just wrote (main) down there and skipped the test. It's my private copy anyway...
18:31sramsayWorked!
18:31sramsayThanks, everyone.
18:31ska2342hiredman: arrow keys to eat the red "apples", after eating some 10 of them, you win. OK, and then it will repeat
18:32hiredmanska2342: not here
18:32hiredmanhere everything happens to fast for keypresses
18:32sramsayAh, yes. Should respond to the arrow keys, yes?
18:32hiredmanthe worm runs into the side of the window with a bunch of red squares blinking in and out around it
18:33sramsayFunny, it suddenly started responding to arrow keys.
18:33sramsaySo, just for the record . . . This is not the best example code from which to learn the language? ;)
18:33hiredmanhe also should be proxying an adapter instead of keylistener
18:33hiredmanI dunno, I guess if you get it to works it's not that bad
18:34sramsayThanks for the help everyone.
18:34hiredmanit's very, uh, workman like? no bells no whistles
18:35ska2342there is a parameter ms-per-move which you may be able to adapt so that the Thread/sleeps a little longer.
18:35hiredman(volkmann like!)
18:36ska2342Revealing my ignorance of Java... what's that about the adapter instead of keylistener? Can you point me to sth to read?
18:37hiredmanwell he proxy's the interface KeyListener and has to put in empty bodies for methods he doesn't care about
18:38hiredmanKeyAdapter is a (maybe abstract?) class that implements KeyListener
18:39ska2342yes, it's abstract and it only exists to avoid the empty method defintions as it seems. Thx for the insight
18:41hiredmanit's not a huge thing, it is nice to have
18:42ska2342nice to know and feels strange that this should live in the standard lib. whatever
18:43hiredmanthe java standard lib is huge
19:06vIkSiThi all
19:07vIkSiTI'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:08vIkSiTfor instance, i was trying out a tutorial that requires clj-http and clj-oauth
19:08vIkSiTI got the sources from github and tried to compile using lein/ant
19:10vIkSiTbut am running into dependency hell (different deps requirements for lein and projects/and my own jars in /opt/jars that have clojure etc)
19:11hiredmanhttp://clojars.org/search?q=oauth
19:11hiredmanwhy are you building it?
19:12hiredman"dependency hell" is a striking image, but doesn't convey any real information
19:13vIkSiThiredman, interesting, I didn't know about clojars.
19:13vIkSiTwell, "dep hell" - refers to - recurisve need for libraries that I wanted to use
19:13vIkSiTrecursive*
19:14hiredmanwhat do you mean recursive need?
19:14hiredmanyou mean you have a circular dependency?
19:14hiredman(I doubt that)
19:14hiredmanhave you read the lein readme?
19:16vIkSiThiredman, more like a neverending dependency. For instance, clj-oauth required clj-http, which in turn requires com/twinql/clojure/http.. and so on .
19:16vIkSiThiredman, reading right now.
19:16vIkSiTalthough one thing confuses me
19:16hiredmanif libraries have a circular dependency you should file a bug with the maintainer
19:17vIkSiTlets say the project.clj for a library I'm trying to use has this : http://gist.github.com/331656
19:17hiredmanwhy are you looking at the project.clj?
19:17vIkSiTnow, doing a lein deps would get these files from wherever, and put them into lib/ ?
19:17hiredmanyes
19:17vIkSiThiredman, well, i'm trying to build the library
19:17hiredmanwhy?
19:17clojurebotwhy not?
19:18hiredmanjust put the requirement in the project.clj for your project
19:18vIkSiThiredman, because i want to use the library in my own program as a starting point to modifying it for my own needs..
19:18vIkSiTthe 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:19hiredmanwhy not through lein?
19:20vIkSiThiredman, I thought lein is like easy_install or apt-get - fetches only from repos?
19:20hiredmanthats why you should read the reame
19:20hiredmanreadme
19:25vIkSiThiredman, hmm which specific part of the readme do you mean?
19:25vIkSiTI'm not sure I see anything that relates to local dependencies
19:26vIkSiTor do you mean using lein jar to create a jar and then use it?
19:28hiredmanclj-oauth checks out and builds fine
19:29vIkSiThiredman, lein deps; ant ?
19:30hiredmanuh
19:30hiredmanyou use one or the other
19:30technomancyvIkSiT: 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:30hiredmanlein jar, or ant
19:30vIkSiTthis is what I was getting, btw: https://gist.github.com/05445c6714e050205169
19:30technomancybut it's pretty experimental right now
19:30vIkSiTusing ant.
19:31technomancyvIkSiT: if you are planning on using that functionality I'd be interested in your input on that thread
19:31technomancyand whether the approach suggested would work for you
19:31vIkSiTtechnomancy ah - let me try to find that entry
19:31vIkSiTthanks for the info
19:31hiredmanvIkSiT: use lein, don't use ant
19:32vIkSiTand 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:32technomancyleiningen and ant are mortal enemies. (see c. stephenson's work on the subject)
19:32hiredmanvIkSiT: lien deps doesn't compile anything
19:32vIkSiTi see. so, lein deps and then lein jar to a) get deps, and b) create jar ?
19:32hiredmanjust run lein jar
19:32hiredmanand read the readme
19:32vIkSiTtechnomancy, heh right
19:33hiredmanclj-apache-http also checks out and builds fine
19:54vIkSiThmm. 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:54vIkSiTrecommended way using lein?
19:56The-KennyvIkSiT: Here's c-http-client on clojars: http://clojars.org/clojure-http-client
19:56The-Kennysearch is a bit buggy there
19:56vIkSiTerrr
19:56vIkSiTthanks, The
19:56vIkSiTthanks, The
19:56vIkSiTthanks, The-Kenny
19:56technomancyvIkSiT: clojars search is currently limited to projects that include descriptions... it's a bug
19:57vIkSiToops sorry for the multipaste.
19:57vIkSiTah I see
19:57technomancyvIkSiT: you can determine the dependencies invokation by looking at clojure-http-client's project.clj file
19:57technomancy*invocation
19:57vIkSiTright.
19:58vIkSiTbut 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:59technomancythe best thing to do in that case is to alter the group id and push it to clojars yourself
19:59technomancythat's described under "publishing" in the leiningen readme
19:59vIkSiTat 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:59vIkSiTtechnomancy, ah hmm
20:00vIkSiTso there is no acceptance policy for lein repos?
20:00vIkSiTin the sense, I could push pretty much anything tehre, unlike say, an apt-get repo which is reviewed etc
20:00technomancyyes
20:01vIkSiTI see
20:01technomancythe decent thing to do is use a custom group-id (org.clojars.viksit) unless you are the original author
20:01technomancybut it's not enforced
20:01vIkSiTah sure
20:01tomojI'm interested in hosting my own repo
20:01tomojso I could push whatever I want there
20:01tomojis this a maven problem?
20:02tomojand, how could I make lein give my repo priority?
20:02tomoj(again, is that a maven problem? I'm lost..)
20:02technomancytomoj: you can run your own clojars instance
20:02technomancyit's open source
20:02tomojaha
20:02tomojgreat
20:02tomoj_ato, right?
20:02technomancyI think you can give your repo priority by editing ~/.m2/settings.xml, but I'm not sure about the details there.
20:02technomancyyeah
20:03technomancyyou could do it using raw maven too, but it would be less fun
20:03tomojok, that's great too, I can modify everyone's settings.xml with chef
20:03technomancyactually you could even just rsync ~/.m2/repository to an http-readable location
20:03technomancythat's all it takes; very simple
20:03tomojoh, hmm
20:04tomojI think I'll be building recipes for running clojure code, so it might be easier just to run clojars
20:04technomancytomoj: if you run into issues with priorities of different repos please file a lein issue
20:04tomojwill do
20:04technomancyI don't know how it will resolve questions of ordering
20:04tomojyeah..
20:05tomojhaving to put that in every project.clj seems weird though
20:05tomojbe nice to have a system-wide way of setting which repos lein uses
22:17joshua-choiAre there any Clojure data kinds whose objects can equal an object of a different kind? Such as lists equaling cons-cells equaling vectors.
22:19joshua-choiOther than the example I gave of course.
22:20clojurebotexamples is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples
22:21tomojjoshua-choi: numbers maybe?
22:21joshua-choiMmm. Yes, that's true.
22:22tomojNumbers and IPersistantCollection are the only special cases in clojure.lang.Util/equiv
22:22joshua-choiAny cases of IPersistentCollection other than lists/cons/vectors? Like maps, sets, I dunno.
22:24hiredmanjoshua-choi: memoize expects to the fn to be a pure function and the input and output to immutable values
22:24joshua-choiMore specifically, that giving vectors and lists to the memoized function must return the same results.
22:24hiredmanoh
22:24hiredmanright
22:25hiredman*that*
22:26joshua-choiIt's obvious in retrospect, but it was the culprit of an insidious, changing bug that I'm still fuming about :)
22:26tomoj,(map coll? [() [] {} #{} clojure.lang.PersistentQueue/EMPTY])
22:26clojurebot(true true true true true)
22:26tomojyet,
22:27tomoj,(= [[1 2]] {1 2})
22:27clojurebotfalse
22:27hiredmanalmost all deftypes will implement IPersistentCollection
22:27hiredmantomoj: if I recall the rationale was someting about maps not being ordered
22:27tomoj,(= [(first {1 2})] {1 2})
22:27clojurebotfalse
22:27tomojah
22:28tomojand sets aren't ordered either
22:29tomoj,(= [1] (sorted-set 1))
22:29clojurebotfalse
22:29hiredmanlinearly ordered?
22:29hiredmanI don't know
22:32technomancyjoshua-choi: I've wondered about that equality puzzle myself.
22:32technomancyI suppose the difference is that maps and sets have very different value semantics since they're generally unordered
22:33technomancywhereas the differences between lists and vectors have to do with perf characteristics and insertion behaviours
22:33technomancywhich arguably do not affect value
22:33joshua-choiUnfortunately, they also affect eval's behavior, and only one of them is a function
22:33technomancystill not sure I'm entirely comfortable with vectors ever being = to lists, but I suspect that's the reasoning behind it
22:34joshua-choiThat was difference enough for this bad memoize bug I had
22:34technomancyagreed; it breaks in unexpected places
22:34technomancyand I can't think of any circumstances where you'd actually want it to work that way
22:35technomancywell; that's not true; I guess it's good that (map identity my-vec) is = to my-vec
22:35technomancysort of
22:35technomancyit's definitely not clear-cut
22:37psykotichmm
22:38psykoticthis comes down to equality being messy. it really depends on context what you want.
22:39psykoticclojure's behavior is definitely useful 99% of the time, when you want to pretend that a sequence is a sequence
22:39hiredmantechnomancy: is it possibly to run lein new from the repl?
22:40technomancyhiredman: sure; all tasks are just functions
22:40technomancyit's going to use the cwd though, which you can't override
22:40technomancymight be a drag
22:40hiredman:/
22:40technomancycould create it then move it
22:40hiredmanI saw a factor video and I am suffering from repl envy
22:41psykoticfuel?
22:41technomancyfactor's repl is slick
22:41technomancywe could make new take a target directory as an optional argument
22:41hiredmanthey have some command to run in the repl to generate a new project structure
22:41psykotichiredman: link to video?
22:41hiredmanuh
22:42hiredmanhmmmm, I think it was a presentation to philly λ
22:43hiredmanI downloaded it a while a go and just got around to watching it
22:43technomancyhiredman: if you haven't seen the fuel video you should watch that too
22:43technomancyfactor's shaping up to be my 2011 language
22:43hiredmanhttp://vimeo.com/6203360
22:44psykotictechnomancy: have you looked at alien, their ffi? it's super nice
22:44psykoticprobably the only nicer ffi i've seen is haskell's
22:44hiredmantechnomancy: where?
22:44technomancyI wouldn't know how to judge an FFI, not knowing C
22:44psykoticfuel is kind of slime for factor
22:45hiredmanohhh
22:45hiredmanyeah that got mentioned in the video
22:45technomancyhttp://factor-language.blogspot.com/2009/01/screencast-editing-factor-code-with.html
22:46psykoticheh, 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:46psykotici'll gist it
22:47hiredman,:o
22:47clojurebot:o
22:47psykotichttp://gist.github.com/331761
22:51psykoticso, 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:51psykoticonly when (run ...) is only done is the t specified, and it's propagated throughout the monadic pipeline
22:51psykoticso, you can write something like (unit 42) and you don't have to say 'this is unit 42 in the callcc monad'
22:52psykoticin 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:57psykoticthe '(fn [t] ...)' in my clj code corresponds to the forall m in that type sig
23:52somniumwhat do people make of this kind of syntax twiddling? http://paste.lisp.org/display/96355 (sort of trying to imitate ml style)
23:53somniummatter of taste or a bad idea?
23:55psykotici'm not a fan of leaving out the parens on the forms
23:59somniumI go back and forth, but been exprimenting with ocaml and F# and a little jealous of ther readability at times
23:59somniums/ther/their