#clojure logs

2009-10-09

10:13snowwhiteliwp, Can you please tell me that tracing library in contrib?
10:14arbschtclojurebot: trace
10:14clojurebottrace is (in contrib) http://github.com/kevinoneill/clojure-contrib/commit/43e4168fc8772225c7f749ffb363b0e2a8f7b84f
10:14arbschthrm, that's no good
10:14arbschttry http://richhickey.github.com/clojure-contrib/trace-api.html
10:14durka42clojurebot: your link is dead
10:14clojurebotYou don't have to tell me twice.
10:15arbschtclojurebot: trace is http://richhickey.github.com/clojure-contrib/trace-api.html
10:15clojurebotYou don't have to tell me twice.
10:15durka42clojurebot: how's my link doing?
10:15clojurebotwith style and grace
10:54LauJensen,(condp = 5 2 "two" 3 "three" :else "no dice")
10:54clojurebotjava.lang.IllegalArgumentException: No matching clause: 5
10:55LauJensenWhy doesn't that give me "no dice" ?
10:56arbscht,(condp = 5 2 "two" 3 "three" "no dice")
10:56clojurebot"no dice"
10:56arbscht"A single default expression can follow the clauses, and its value will be returned if no clause matches."
10:57LauJensenAh, how inconsitent, thanks arbscht
10:58arbschtif there was :else or :default semantics, I think you couldn't use those keywords as a test-expr
10:59JAS415,(= :z :z)
10:59clojurebottrue
10:59JAS415wonder why that is broken on my clojure
11:00arbschtJAS415: what is your clojure?
11:00JAS415{:interim true, :major 1, :minor 1, :incremental 0, :qualifier "alpha"}
11:01JAS415i must need to update again from the repository
11:30gerryxiaohello
11:31gerryxiaowhat's "Exception in thread "main" java.lang.Exception: No dispatch macro for: / (clj:1)"?
11:32gerryxiaowhen run clojure as script
11:32gerryxiaoclj somefile.clj
11:33raekgerryxiao: what does your clj file look like?
11:34gerryxiaojust common clj file
11:34gerryxiaoif i loaded in repl, it works
11:35JAS415i think clojure github link might be broken
11:36raekthe script must be run with java -cp /sq/ext/clojure/clojure.jar clojure.lang.Script
11:37gerryxiaoraek: i have tested "(defn add [ a b] (+ a b)) (add 3 4) " as a clj file, i still got that msg
11:38gerryxiaois there something wrong with my clj script? but i have been worked till recently
11:38gerryxiaos/i/it
11:39raekecho "(defn add [ a b] (+ a b)) (print (add 3 4))" > test.clj
11:39raekjava -cp your-classpath/clojure.jar clojure.lang.Script test.clj
11:40raekdont forget the "clojure.lang.Script" part
11:40raekalso, the program will have to print the values
11:40raeknot just evaluate them
11:40JAS415oh
11:40JAS415well you have like a bash script named clj though
11:41gerryxiaook, it seems working
11:42JAS415o
11:42JAS415what did you do?
11:42gerryxiaoso, that's problem of my clj script
11:42JAS415oo
11:43gerryxiaobut my clj script is copyed from clojure wiki
11:45gerryxiaojava -server -cp $CLOJURE_JAR:$CONTRIB_JAR:$SWT_JAR:$JSR:./classes:./src clojure.lang.Script $0 -
11:45gerryxiao$0 -- $@
11:45gerryxiaowhat's wrong?
11:45ngocHi, how to tell Ivy to download clojure and clojure-contrib from http://tapestry.formos.com/maven-snapshot-repository/?
11:47ngocIt seems that Ivy only search http://repo1.maven.org/maven2. How to tell it to search http://tapestry.formos.com/maven-snapshot-repository/?
11:47JAS415for the ./classes and ./src, what is that?
11:47JAS415current directory?
11:47lpetithello, do you know if there is a way to correctly print enclojure wiki's pages ?
11:52raekgerryxiao: what happens when you run the same thing, but with clojure.lang.Repl instead of .Script?
11:53gerryxiaorepl works
11:53raekstrange
11:54raekI'm afraid I'm out advice...
11:55gerryxiaofirst output result then into repl user prompt
11:56gerryxiaowhat's the meaning of "no dispatch macro for :/"?
12:01raek,(keyword "" "")
12:01clojurebot:/
12:03raekwhat is the first line of the file?
12:03raeka shebang line?
12:03gerryxiaoJAS415 ./classes ./src , yes classes and src dir under current dir
12:04JAS415assuming that the cp is right, the only thing that changed is the args
12:05JAS415$0 -- $@
12:14gerryxiaoit's odd
12:14gerryxiaojust type: clj a , i 'll get same error
12:16gerryxiaoBREAK_CHARS="(){}[],^%$#@\"\";:''|\\"
12:17gerryxiaoraek: yes shebang line
12:18gerryxiao#/bin/bash
12:18gerryxiaooops, no bang :)
12:18raekwhat's the first line in the .clj file?
12:22gerryxiaoappend ! to # still not work
12:31gerryxiaook, solved
12:31gerryxiaochange $0 to $1
12:31gerryxiaothx
12:31gerryxiaoi have forgot what's bash :)
12:35gerryxiaoraek: #/bin/bash
12:42raek#/bin/bash
12:42raekin a clojure script file?
12:42technomancywhat determines which milestone a ticket should be on?
12:43technomancyshould I just leave it on backlog and let a committer move it if it's appropriate?
12:46gerryxiaoraek: bash script
12:47gerryxiao$0 is bash script itself,so i got that error
12:48technomancythere are an awful lot of open tickets in assembla... do we need more people reviewing patches?
12:52chousertechnomancy: only rich changes the milestone
12:52technomancychouser: gotcha
12:53chouseralso, only rich changes a ticket with a patch from unapproved to approved.
12:54technomancychouser: seems like it would be helpful to have others try out patches and leave comments etc so he doesn't have to waste his time with stuff that's broken
12:54chouserThe big queues are generally tickets with "next release" milestone that have no patches.
12:54jaiganeshhi
12:54chousertechnomancy: yes, that could be helpful -- I'm sure he'd appreciate comments to that effect.
12:54jaiganeshi was attempting problem no 4 from projecteuler.net
12:55jaiganeshi came up with this solution
12:55technomancychouser: just thinking since we copied the patch submission process from rails, what they do is get people to vote +1 for patches, and they don't get considered until a patch has at least three votes
12:55chouserthe other place they tend to queue up is when they have a patch but rich hasn't had the time yet to approve, but I don't think much can be done about that except as you said to help improve the patch as much as possible before he looks at it, and then have more people recommending approval.
12:55technomancyobviously that's a larger community, but it might be worth trying to get more people involved.
12:56jaiganesh, (apply max (map (fn [[x y]] (* x y)) (filter #(= (seq(str (* (nth %1 0) (
12:56jaiganeshnth %1 1))))(reverse (str (* (nth %1 0) (nth %1 1)))))(selections (range 100 1000
12:56jaiganesh) 2))))
12:56clojurebotEOF while reading
12:56technomancychouser: does he personally vet all patches to contrib as well?
12:56chousertechnomancy: no
12:56jaiganeshbut it takes long time..can anyone please tell me y
12:56chouserI was speaking only of clojure itself.
12:57technomancychouser: I see. does that include things like clojure.test too?
12:57chouseryes, everything in the main clojure git repo ... though I think changes to tests get rather less scrutiny
12:58technomancychouser: thanks for the explanation
12:58chousersure.
12:59chouseryeah, contrib is a rather more distributed process. That should theoretically help things move quicker though in practice it's sometimes take some effort to find someone to take reponsibility for a particular patch to be applied.
13:00technomancywell it makes sense given the purpose. if something graduates to clojure itself, it will get plenty of additional review
13:00chouseryes
13:00jaiganeshhow to write a code snippet here so that it does not wrap to multiple lines
13:00technomancyspeaking of finding someone to take responsibility... I took the liberty of assigning my delete-file patch that I mentioned a few weeks ago to you. =)
13:01chouserjaiganesh: that depends mostly on your irc client. You can use a paste site for bigger things.
13:01chouserlisppaste8: url
13:01lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
13:01chousertechnomancy: ok, thanks for the heads up. I'll try to take a look at it.
13:02technomancythanks. =)
13:02jaiganeshok thks
13:03lisppaste8jaiganesh pasted "Problem No 4 projecteuler" at http://paste.lisp.org/display/88432
13:04jaiganeshthe above code is taking lot of time..can anyone please tell me why so?
13:04jaiganeshthough i get the correct answer
13:47ambientjump to definition in emacs/clojure would be pretty sweet
13:48technomancyambient: you mean M-.?
13:48ambientiirc there was metadata in function in which file it was defined, the feature wouldn't even necessarily be that hard to implement?
13:48ambientwot?
13:48technomancy=)
13:49ambientthat seems to work with tags :/
13:49technomancynot if slime is enabled
13:49technomancy"M-. runs the command slime-edit-definition"
13:50ambientthat only works in the current directory?
13:51technomancyno, it works in any clojure buffer where slime is enabled
13:51technomancythe buffer has to be loaded, of course
13:52ambienti did M-x slime, and M-. doesn't even work inside the same file
13:53technomancyambient: do you have slime-mode turned on in your .clj buffer?
13:53ambient(Clojure ElDoc Slime[clojure])
13:54ambientit either telle me that there is no such class or "No known definition for: ... (in ...)"
13:54technomancyweird; I wonder what's wrong with your setup
13:56ambient*shrug*
13:58ambientfwiw here's my .emacs http://pastebin.com/m23f3fe9c
13:59dnolencgrand: thanks for starting the Enlive group, I posted my ramblings about template inheritance there.
14:04cgranddnolen: ok. Is there an html file for the inheriting template or only an html file per part (column here)?
14:07dnolencgrand: well I suppose in Enlive it wouldn't really be template inheritance... um... is the idiomatic Enlive approach. pageTemplat <- navTemplate <- [widgetA, widgetB] ?
14:08dnolenif so it would just be nice to have an example saying you can accomplish the same means, you just have to think about it differently
14:08cgranddnolen: I think both are possible
14:14hiredmanhttp://www.youtube.com/watch?v=iHIaH12f2Ek <-- I call lisp machine
14:15dnolencgrand: cool, how would you organize your code to do it the "traditional way" ?
14:16wavishiredman: Guest VM = Lisp Machine ?
14:17cgranddnolen: I'll reply on the group
14:17dnolencgrand: thx
14:17hiredmanwavis: Yes.
14:17hiredmanwell, it is a metacircular jvm running as a xen guest
14:26snowwhitei am still not sure how to use deftrace for debugging a clojure function?
14:26snowwhiteChousuke, ?
14:30hircusrhickey: ping
14:31hiredman~seen rhickey
14:31clojurebotrhickey was last seen joining #clojure, 461 minutes ago
14:31hircushiredman: aha, nice. thanks. I forgot about clojurebot
14:44G0SUBwhere can I find the docs of clojure.test ?
14:52rhickeyhircus: pong
14:52rongenreIs classpath the only way to specify where namespaces can be loaded? It'd be convenient to mess with it within the clojure program.
14:54stuartsierraGOSUB: at the moment, in the source
14:54JAS415penumbra is sweet, i need a new graphics card though, this one is melting...
14:56ambientyeah
15:04ambienti can't quite believe that gpu programming could be so simple as it seems with penumbra
15:05ambientpenumbra seems to be using pixel shaders or such, im not sure how well the DSL would work with CUDA or respective ATI interfaces
15:06G0SUBstuartsierra: ping
15:06G0SUBstuartsierra: deftrace apparently has a bug. it doesn't work if the function has a doc string. as in, it does not entirely replace defn
15:08stuartsierraGOSUB: ok, please make a ticket
15:10waviswhy is pushThreadBindings on the Var class static? it seems odd to me to manage an instance of Var as global state...
15:11JAS415ambient: well the amount of abstraction that clojure allows makes me believe that you could probably do a similar thing for other interfaces
15:12JAS415ambient: admittedly i've only played with it enough to tweak the mandelbrot example around a bit and have that kind of blow my mind
15:13G0SUBstuartsierra: wow, I can't find the link to create a new ticket on Assembla.
15:14ChousukeG0SUB: are you a member?
15:14G0SUBChousuke: no. I just registered.
15:14Chousukeif not, you need to use the support tab.
15:16G0SUBChousuke: OK. Now watching that page.
15:23G0SUBstuartsierra: there you go https://www.assembla.com/spaces/clojure-contrib/support/tickets/35-clojure-contrib-trace-deftrace-does-not-work-with-function-definitions-with-doc-strings
15:23G0SUBstuartsierra: thanks.
15:24stuartsierrathx
15:25riddochcComment, then question: last weekend, I was dubious about clojure. Then, I read the book, documentation, and watched the videos this week, and now I'm rather impressed and pleased that clojure's an option. So, thanks for clojure.
15:30JAS415where was the question
15:31riddochcquestion: not being as familiar with the concurrency primitives, I'm having some difficulty making an idiomatic code that triggers a function if another function takes longer than a given time.
15:31Chousukehmm
15:31ChousukeI think Futures support a timeout
15:32riddochcImagine a library that would support something a little like 'expect' on Linux/Unix, for an use-case.
15:34riddochcI'm not quite familiar enough with functional algorithms to know how to map something that seems most natural for me to think of as a state-machine, with timeouts or pattern matches determining transitions.
15:35riddochcSuggestions?
15:36riddochcMost other algorithms I've tried to implement with clojure so far are pretty natural to do in a functional style, but this one has me stumped.
15:39Chousukehmm
15:40Chousukea state machine is not too difficult to do functionally I think
15:40wavisriddochc: I don't know about idiomatic, but why not run one function in a thread, and start another thread that joins it with at timeout, checking if it's running and then calling fn2?
15:40drhodesthere's neat article, http://eli.thegreenplace.net/2009/08/29/co-routines-as-an-alternative-to-state-machines/ but the language is python
15:40Chousukeyou could consider a timeout simply another kind of state.
15:43ChousukeI suppose the whole process wouldn't really be functional (since you'd get different results from the state machine run depending on where timeouts happen) but the logic implementing the state machine itself could be just a function of state -> next state.
16:03riddochcChousuke: Okay, I'll look into that.
16:07riddochcwavis: That was my first thought... as far as I can tell, that would want an agent?
16:10hiredmanheadius is everywhere
16:10hiredmanhttp://kenai.com/projects/maxine/lists/users/archive/2009-10/message/4
16:10arohnerChouser: in clojurescript, how do you distinguish between property access and function calls?
16:10headiushiredman: this is what I do :)
16:11hiredmanheadius: every where I go, "HEADIUS WAS HERE"
16:12headiuswell, we're pushing the boundaries with jruby...gotta dig deep
16:12hiredmanmaxine looks really cool
16:16headiushiredman: yeah, it definitely is
16:16headiusI'm hoping to work with them on it to potentially make a "JRuby VM" out of it
16:16hiredmannah, maxine is going to be my lisp machine :P
16:16headiuslisp is easy
16:16clojurebot"if you never learnt Lisp, then you never learned to program" -- some rant on some blog somewhere
16:17hiredmansure, tell that to cll
16:18headiusbut what I want out of maxine is similar to what lisp (or clojure) would want: fixnums, maybe smarter support for enclosed variable scopes
16:18headiustail calls would help lisp/clojure more than it would help ruby
16:18headiusbut they'd be nice too :)
16:18hiredmannow if only maxine would build on freebsd
16:20headiuswell, that is one limitation :) it's fairly platform-limited right now
16:20headiusI only need OS X and 64-bit linux though
16:22hiredmanI think the osx target should build on freebsd with some tweaking
16:23headiusprobably
16:24riddochcI started learning CL about 10 years ago. Spent more of my time using Ruby, over the past 5 years, occasionally missing things from CL.
16:25riddochcCan I assume that the lack of multiple return values is a limitation of the JVM rather than a design choice by Clojure?
16:26hiredmanI think it is needed for compatibility with the java callstack
16:29riddochchiredman: I figured as much. I like CL's gethash: 1st retval, the value in the hash. 2nd retval, whether key's found.
16:31hiredmanI've never used multiple return values, single return just seems cleaner
16:31hiredmanif I want to return multiple things, I can return a contained containing multiple things
16:49kunleyHi.
16:49kunleyIs anyone using slime to conenct to an existing clojure repl?
16:50arbschtconnecting to swank, yes
16:57drewrI do too
16:57drewrbut yeah, it needs to speak swank
16:59kunleywell I just assumed it will be the standard way to use slime, so for a moment I wondered why it seems to be omitted in the wikibooks and in the clojure-mode readmes.
16:59kunleyAnyway, I found in swank-clojure.el how swank server should be started.
17:00drewrI imagine most people just do the standard let-slime-manage-the-inferior-lisp thing
17:00arbschtwhich readmes?
17:01kunleyarbscht: ones of swank-clojure and clojure-mode. Anyway, the bits needed to run on the clojure side are in the source.
17:01arbschtthe standard way to use slime is to invoke "M-x slime" in emacs, and that will instantiate a new clojure (or other lisp) process
17:03kunleyarbscht: yes, for some values of 'standard'. Anyway, after I asked here I found my answer in the source.
17:12riddochcAnybody got a tutoral for building java code/fighting with classpath? Google's giving me a lot of random useless links of people asking the same question, rather than answers. :/
17:13riddochcAs much as I'd like to stay as far inside Clojure as possible, I need to make stuff I'm working on available as a thrift service, and running into brick walls just knowing how to use javac/ant correctly.
17:14arbschtriddochc: this might explain some things http://java.sun.com/javase/6/docs/technotes/tools/findingclasses.html
17:15riddochcarbscht: That looks decidedly useful. Thanks!
17:24itistodaymodest proposal: improve the API?
17:25itistodayerr, rather, the documentation on the API?
17:25itistodayi'm coming from newLISP and i really like how they've organized their api, here's a link:
17:25itistodayhttp://www.newlisp.org/downloads/manual_frame.html
17:26itistodaythe clojure api docs are organized by what seems to be namespaces
17:26itistodayor some extremely primitive form of organization
17:26itistodaywhere a whole bunch of stuff in placed in "clojure.core"
17:27itistodayright now i'm learning clojure, and it would really help if the api docs were better organized
17:27itistodayfor example, in newLISP there's a function called lambda? to check if something is a function
17:27ambienti found that just reading the source is about the same as reading the API doc
17:27ambient(if not even better)
17:27itistodayambient: the source for what?
17:27ambientseems like most of the API doc is direct copy & paste from clojure source
17:28itistodaywell that's probably why it could use so much improvement :-p
17:28itistodayi'd even be happy to dedicate some time to it myself
17:28itistoday(don't know who to ask though)
17:28itistodaybut just as an example
17:28ambientitistoday core.clj from src/clj/clojure
17:28itistodayi wanted to know what the equivalent to lambda? was in clojure
17:28ambientfn
17:29itistodayand it wasn't easy to find that because fn? is just thrown in amongst the hundreds of other functions with zero organization
17:29itistodaycheck the newLISP link
17:29ambienthttp://java.ociweb.com/mark/clojure/article.html
17:29ambientthis is pretty good introduction to clojure imo
17:29itistodaywell i'm not talking about a tutorial
17:29itistodaybut a useful set of reference documentation
17:29itistodaythe newLISP stuff is organized by purpose
17:30itistodayi.e., it has a section on the left called Predicates, and *all* of newLISP's built-in predicates are there
17:30itistodayso instantly at a glance you know exactly where to look if you want to compare something
17:30technomancyany old java hands around that could tell me what's wrong with this simple 3-line log4j config? http://p.hagelb.org/log4j.properties.html
17:32itistodaywho/where should I speak to about helping out with clojure's api docs?
17:33ambientmost of the dev team hangs out in this channel afaik, there's also clojure dev http://groups.google.com/group/clojure-dev .. im a total newb though :)
17:33itistodaybtw, are strings in clojure utf8 or ascii?
17:33hiredmanthey are java strings
17:34ambientas clojure supports utf8 as language constructs, i'd reckon utf8
17:34technomancyutf16
17:34technomancythe JVM predates utf8 iirc
17:34arbschtitistoday: you could try the mailing list. I'd suggest producing some kind of documentation first and seeing if anyone else likes it
17:34itistodayso java strings are UTF16 by default?
17:34hiredman~jdoc String
17:35Chousukethe default encoding is defined by a property
17:35itistodayarbscht: well there's already the newlisp documentation, i would just be proposing to do a similar thing
17:35ambientitistoday your link to the newlisp doc didn't work btw
17:35Chousukebut a java char is a 16-bit UTF-16 character
17:36itistodayambient: really? what's wrong? it's working for me..
17:36ambientnvm it was just my irc client
17:36itistodayChousuke: is there a way to change to utf8 by default?
17:36itistodayover the past year or so i've come to worship utf8
17:36Chousukesure, but don't ask me how :P
17:37Chousukeyou need to just configure the property somewhere
17:37hiredmanno
17:37itistodayhiredman: not possible?
17:37hiredmanstrings and chars are utf16
17:37itistodayhiredman: hard-wired in the jvm?
17:37hiredmanit is possible to change file encodings
17:37stuartsierraThe JVM spec says chars are 16 bits.
17:37hiredmanor the encodings on output streams
17:38hiredman~jdoc Character
17:38itistodayyou know one day we're going to meet an alien species and that's when they're finally going to get around to realizing that utf8 is the best encoding (currently) available..
17:38hiredman"The char data type (and therefore the value that a Character object encapsulates) are based on the original Unicode specification, which defined characters as fixed-width 16-bit entities."
17:40Chousukeitistoday: it's not just the encoding that matters :/
17:40Chousukeitistoday: though of all the options, unicode is the least bad :P
17:40technomancyChousuke: says the Finn. =)
17:41Chousukebut even unicode isn't perfect. Having multiple possible representations for a single string is not quite ideal :P
17:43itistodayChousuke: yeah, but like you said, it's the least bad, or the converse, the best we have so far :-p
17:43itistodayambient: thanks for the clojure-dev link, i'll offer the suggestion there
17:44Chousukenormalisation algorithms exist, but then you run into problems if two systems expect the strings to be in their preferred normalised form ;/
17:44Chousukesince there are multiple
17:44arbschttechnomancy: I think you want File, not Target
17:44ChousukeWhat this all means is, I can't share files from Debian to my OS X laptop over NFS.
17:44technomancyarbscht: thanks; I tried that and got the same error
17:44arbschtwhat's your error?
17:45technomancyarbscht: it's quite helpful: log4j:WARN No appenders could be found for logger (user).
17:45technomancyand then it helpfully suggests that I "initialize the log4j system properly."
17:45technomancywhich sounds like a great idea to me.
17:49arbschttechnomancy: is the properties file in the classpath?
17:50technomancyarbscht: actually it's using the -Dlog4j.configuration= flag, which is likely the problem
17:50technomancyI pointed it at a known good file and it gave the same error
17:52tomojwhere is the clojure finger tree stuff at?
17:53tomojoh I found it.. Chouser/finger-tree
17:54tomojlooking for a priority queue which can tell me quickly whether something is already in the priority queue
17:54tomojdo finger trees sound right? reading the paper now
17:56hiredmanI don't think so
17:56tomojdarn
17:56hiredmanyou might keep a set+pq
17:57tomojyeah
17:57tomojactually I guess I can just use a seq of queues too
17:59technomancyarbscht: properties file has to be on the classpath; go figure
17:59technomancya "file not found" message would have been great
18:01arbschttechnomancy: did you try passing log4j.debug? I wonder if that would have given more info
18:01technomancyah, the irony of a logging system hiding crucial messages because the wrong level was set is just too much! =)
18:02arbschthah
18:02technomancyarbscht: yeah, that certainly helps; will try that in the future
18:02technomancythanks
18:02arbschtgreat
18:25rongenreOne question -- I'm running clojure and slime, which did its own clojure install. Any idea how to upgrade clojure?
18:25ambienti use M-x clojure-update
18:26rongenreUrgh.. I did a ^H-a upgrade and got nothing. Ok, thanks
18:28itistodayrongenre: you using OS X?
18:29rongenreNope, this was on a linux box
18:29itistodayah k, nm
18:29rongenreI did have a hell of a time getting clojure to install on osx, since ports put git in /opt/local
18:29rongenrebut I messed with dotfiles and eventually it worked
18:29technomancyrongenre: apps launched from the GUI don't inherit env vars from properties... submit a bug report to Apple. =(
18:30itistodayrongenre: took me no time at all: http://github.com/citizen428/ClojureX/tree/master
18:30itistoday(I didn't do it through ports)
18:31rongenreGotcha.. yeah, I had my emacs and git installed through ports, and then tried to use the emacs package stuff to get slime
18:31rongenreEventually it worked... clojure mode's a strange beast. It also ignores CLASSPATH unless you mess with .emacs
18:32technomancyrongenre: again, environment variables get ignored due to that bug. nothing we can do about it.
18:32rongenreWell this is on linux.
18:33technomancyoh, right. the java command accepts either a -cp argument or the $CLASSPATH variable, not both
18:33Chousukeisn't use of the CLASSPATH env var usually discouraged?
18:33rongenreYeah, I put some code in .emacs to do stuff with swank-clojure-classpath
18:33Chousukeyou should just use -cp every time.
18:34rongenreI can't answer -- I'm slowly using clojure scripts in place of jython scripts. And we've always built up a CLASSPATH env.
18:34rongenreTrying to make it painless
18:34technomancythat's not a word you hear in connection to the classpath very often. =\
18:35rongenreNo I really dislike classpaths, but they work ok for a bunch of console apps.
18:36Chousukemy emacs config is a bit more complicated than itistoday's, but clojure+slime is not too hard to set up once you figure out the basics :)
18:36ChousukeI don't use any of the automagic though.
18:37rongenrekey, for me, was setting up (and knowing about ) swank-clojure-classpath
18:37tomojI just use swank-clojure-project
18:39Chousukehttp://github.com/Chousuke/emacs.d/blob/master/init-clojure.el this is what I do.
18:39ChousukeI wonder if the custom lisp implementation is even required anymore though
18:39ChousukeI needed it to get slime/clojure use UTF-8 :/
18:40Chousukelatin1 is not quite satisfactory :P
18:42ChousukeI think I've also quite succesfully butchered the starter kit, but if it works for me, it's good enough :)
18:42tomojanyone else noticed problems with the clojure repl and the | character?@
18:43arbschteurk, that looks a lot like the mess in my init file
18:44itistodayChousuke: I think the emacs-starter-kit is a misnomer, it's pretty bloated
18:44itistodayright now i'm putting off fighting with it to slim down all the excess to get decent loading emacs loading times
18:45itistodays/loading emacs/emacs/g
18:45technomancyitistoday: spoiler alert: 90% of that is nxhtml
18:45arbschttomoj: problems?
18:46tomojarbscht: as in, it gets confused about whether or not the input is complete
18:46tomojmaybe it's paredit's fault, I dunno
18:46Chousukeitistoday: it contains lots of good stuff though.
18:46itistodaytechnomancy: don't get me wrong, i like that you've put in this work, I'm just saying i'd have done it much differently. there's wayyy too much stuff in there by default
18:46Chousukeitistoday: and it's pretty easy to disable stuff I don't use, anyway
18:47technomancyitistoday: most of it is autoloaded so it doesn't affect startup time. nxhtml is the main offender since it's so complicated
18:47technomancyjabber.el might be bad too
18:48itistodaytechnomancy: yeah, and paredit mode by default i think is another offender
18:48technomancyitistoday: paredit will pay you back many times over if you give it the chance.
18:49itistodaytechnomancy: it's actually a nice package, but i don't like how it works. i spent several hours hacking it to get it to behave the way TextMate does
18:49tomojI am glad the emacs-starter-kit dropped me into it :)
18:49technomancytomoj: that was my plan! glad to see it worked. =)
18:51itistodayi'm sure i could get used to it, but you have to keep in mind that some people are perfectly happy with the way they're used to writing code, and just because you think it's great doesn't mean they should spend a couple of hours figuring out how the hell it works and adjusting to it... </rant>
18:51technomancyyeah... I should put a note in the readme about how to turn it off
19:52LauJensenFor those who like MacSwing, Enlive and Clojure: http://www.dzone.com/links/macswing_meets_enlive_functional_social_webscrapi.html
19:58arbschtLauJensen: have you looked at fnparse?
19:58LauJensenA long time ago, yes
19:59tomoj"Well all that's true of Perl, but people still use that" haha
19:59arbschtI find fnparse alleviates the readability and maintainability issues to some extent
20:00LauJensenarbscht, more so than enlive?
20:00LauJensentomoj, couldn't help it :)
20:00arbschtLauJensen: no :]
20:01LauJensenI figured :)
20:01arbschtbut for those cases where you need regexes, it's nice to have 1.5 problems rather than 2
20:01LauJensenI was quite impressed with Enlive - Look forward to spending some more time on it
20:01LauJensenarbscht, but you noticed that I totally weed out regex in that post, and use Enlive instead?
20:01LauJensenFinally concluding that regex and perl are the shortcut to getting fired?
20:02arbschtLauJensen: right - but maybe it's worth mentioning fnparse in your post, in passing, so the clojure solution to regular expressions isn't forgotten?
20:03LauJensenarbscht, it's 02:00 here now, so can you hang on while I consider it till tomorrow? :)
20:03arbschtsure thing
20:04LauJensenGreat - good night all - Please leave a comment if you liked the post, if you hated it, please email cgrand
20:36gilbertleunghi... i'm a newbie in clojure
20:36gilbertleungcould someone explain y
20:37gilbertleung(apply + [ 1 2 3 4 5])
20:37gilbertleungworks
20:37gilbertleungbut (apply + (1 2 3 4 5))
20:37gilbertleunggives me "java.lanag.Integer cannot be cast to clojure.lang.IFn" ?
20:40gilbertleungwait nvm
20:40gilbertleungmissing quote
20:43ambientyep
20:44ambienthalf of the problems can be usually solved by simple rubber ducking ;)
20:44ambienthttp://c2.com/cgi/wiki?RubberDucking
21:24redalastorI'm strugling with seqs. I'm trying to convert some Python code. I have a list of sudoku square ("A1", "B2", etc...) and a list of units (groups of nine sudo squares). I'm looking for a way to get a map where the keys are the squares and the values are the associated squares.
21:24redalastorThere's probably an easy way to do that, but I'm currently confused.
21:26arbschtredalastor: can you link to the python code? (I don't know sudoku)
21:26redalastorSure, http://norvig.com/sudoku.html
21:27redalastorI'm trying to get "units".
21:30redalastorThe dict constructor trick he's using is that he feeds it a list of (key, value) tuples.
21:39hiredman,(into {} '([s b] [c d]))
21:39clojurebot{s b, c d}
21:39hiredman,(zipmap '(s c) '(b d))
21:39clojurebot{c d, s b}
21:40rottcodd,(apply assoc {} (interleave [:a :b :c] [1 2 3]))
21:40clojurebot{:c 3, :b 2, :a 1}
21:44redalastorAny insight on my sudoku problem?
21:56arbschtredalastor: here's a poor first pass http://gist.github.com/206521
21:58arbschtI won't even guarantee that's correct yet ;)
21:58redalastorI think it's good, I was mucking with loop/recur and not getting anywhere.
21:58briancarperredalastor: if you use Clojure's `for` you can almost use Norvig's version verbatim.
21:58arbschtwell, it's correct as far as units
21:59arbschtright, but there's likely better idioms, especially if you were to use c.c. libs
21:59redalastorbriancarper: With a few str thrown in, so that characters and strings will mix.
22:00lisppaste8briancarper pasted "Sudoku units (lame version)" at http://paste.lisp.org/display/88456
22:02redalastorbriancarper: Yes, very close indeed!
22:04arbschtmy peers appears correct, too
22:05arbschtit isn't pretty clojure, though, despite its similitude to the python version
22:06redalastorWhat would make it prettier clojure?
22:06arbschtI'll have to think about that :)
22:07redalastorThe Python version is actually pretty Python.