#clojure log - Oct 17 2009

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

0:22 jaiganesh: hi

0:23 durka42: hi jaiganesh

0:23 jaiganesh: how can i split a string of this format "\"DARELL\",\"BRODERICK\",\"ALONSO\""

0:23 into a list

0:24 durka42: ,(seq (.split "\"DARELL\",\"BRODERICK\",\"ALONSO\"" ","))

0:24 oops, we are botless

0:24 that gives you ("\"DARELL\"" "\"BRODERICK\"" "\"ALONSO\"")

0:25 jaiganesh: n how to remove \

0:25 arbscht: and there is (split s re) in c.c.str-utils2

0:26 durka42: user=> (map #(.substring % 1 (dec (.length %))) *1)

0:26 ("DARELL" "BRODERICK" "ALONSO")

0:29 jaiganesh: durka42:interesting, what is *1

0:29 durka42: (require '[clojure.contrib.str-utils2 :as s]) (remove empty? (s/split "\"DARELL\",\"BRODERICK\",\"ALONSO\"" #"[\",]"))

0:30 *1 is the previous value from the REPL

0:30 jaiganesh: k

0:30 durka42: ^ using the function arbscht pointedo ut

0:31 jaiganesh: THANKS

0:31 arbscht: (map #(-> % (ss/drop 1) (ss/butlast 1)) ...)

0:34 or (map #(-> % (ss/drop 1) (ss/chop)) ...)

0:35 I wonder why the trim functions don't take an optional character or character-class argument

0:36 durka42: agreed

0:37 arbscht: (map #(ss/replace % #"(^\"|\"$)" "") ...)

0:37 durka42: > (s/replace "\"blah\"" #"^\"+(.*)\"+$" "$1")

0:37 "blah"

0:38 arbscht: (map #(ss/replace % #"(^\"+|\"+$)" "") ...)

0:39 bah, no clojurebot to remind us of the evil of regex :)

0:39 jaiganesh: :)

0:41 durka42: (defn strip [st chars] (ss/replace st (re-pattern (str "^[" pat "]*(.*)[" pat "]*$")) "$1"))

0:42 oops, (defn strip [st chars] (s/replace st (re-pattern (str "^[" chars "]*(.*?)[" chars "]*$")) "$1"))

0:46 * durka42 needs sleep

0:49 solussd: I have emacs configured with 'clojure-install'. How do I add a path to my classpath?

1:03 tomoj: solussd: there's swank-clojure-classpath

1:03 I prefer using swank-clojure-project

1:04 just stick all the jars you need in a lib/ dir, with a src/ dir for the clj sources, then M-x swank-clojure-project, pick your project dir, and it sets up the classpath for you

1:04 though you need to stick copies of clojure.jar and clojure-contrib.jar in there too

1:05 and with that method you have to restart the repl (or do something funky I don't know about) if you add a jar

1:05 solussd: awesome- thanks

1:06 tomoj: you could probably use the source for swank-clojure-project as inspiration for something funky you wanted to do, too, if it doesn't do exactly what you want

1:12 somnium: you can just put the path to your clojure and contrib jars in the clojure-project source

1:13 I modified it to grab some extra jars for app engine stuff

1:22 hiredman: well, clojurebot includes a mini webserver now :(

1:26 tomoj: where is it?

1:28 hiredman: http://gist.github.com/212251

1:28 for querying factoids via json

1:29 still a few debug prn statements

2:17 http://www.thelastcitadel.com/lab/clojurebot.html <-- javascript pulling factiods from clojurebot

2:49 tomoj: has anyone gotten a remote slime repl to work with tramp?

2:50 it seems to me that swank-clojure is not providing enough information about the connection for slime-tramp.el to work

6:31 LauJensen: Morning gents

6:50 ambient: morning

6:53 sfuentes: Goodnight over here :)

7:13 LauJensen: Well it's noon + 1 here actually, but it feel strangely like morning, just seconds before the coffee kicks in :)

10:00 solussd: If I try running m-x swank-clojure-project from emacs and I type in a path and hit enter, I simply get another line, it doesn't _do_ anything. any ideas?

10:00 tomoj: "another line"?

10:00 it's supposed to start a repl

10:01 Chousuke: as in, instead of sending the command you get a newline?

10:01 weird

10:01 solussd: Yes.

10:02 Dawgmatix: are there any plans to add swank-clojure to upstream slime ?

10:02 Chousuke: it's probably easier to develop as a separate project :P

10:02 solussd: I installed everything using m-x clojure-install

10:03 Chousuke: the slime people use CVS :(

10:05 konr: Is there a function to find out if an element is NOT a sequence, like (not (list? "foo"))?

10:06 or (not (seq? "foo"))

10:09 solussd: All I want to do is add a .clj to my classpath so I can access it via (require 'path.to.lib) Nothing I've stumbled upon on google seems to work.

10:17 tomoj: solussd: you mean a newline appears in the minibuffer?

10:17 solussd: yes

10:17 tomoj: that's very odd

10:17 solussd: I thought so. :)

10:18 trying to make my way through the clojure book.. stuck until I can define my lib path

10:20 tomoj: are you using the emacs-starter-kit?

10:21 solussd: no, just emacs/aquamacs. I installed all the clojure stuff using M-x clojure-install

10:22 *aquaemacs

10:22 *aquamacs emacs? :)

10:23 tomoj: hmm

10:24 I've always had ido-mode when using swank-clojure-project

10:24 I would think it should work without it, though..

10:25 ericthorsen_: er

10:25 namor: "Many programming languages mix pure functions and side effects in completely ad hoc fashion. Not Clojure. In Clojure, side effects are explicit and unusual" (p48 Programming Clojure) -- What exactly does that mean? Isn't it just as simple to have side effects in Clojure as in Java? Just write print in a function body for instance..

10:26 tomoj: I think they're specifically talking about mutating some data

10:26 arbscht: namor: that may be better worded as "In Clojure, mutation is explicit and unusual"

10:26 namor: Yes, that makes more sense.

10:29 tomoj: hmm, does emacs come with ido by default?

10:29 ambient: not mine at least

10:29 installed separately

10:29 i find it very hard to do side effects in idiomatic clojure :P

10:30 tomoj: solussd: do C-h f ido-read-directory-name

10:32 solussd: i get a seperate buffer with this: do-read-directory-name is an autoloaded Lisp function in `ido'.

10:32 (ido-read-directory-name prompt &optional dir default-dirname

10:32 mustmatch initial)

10:33 tomoj: guess you have it then

10:34 well.. if all else fails you can just manually set swank-clojure-classpath, I guess

10:35 dunno what would cause the interactive arg not to work

10:40 solussd: How do I 'append' to swank-clojure-classpath ?

10:40 I've tried a few ways, but none seem to work

10:47 konr: what is the clojure equivalent of CL's (atom foo)?

10:51 tomoj: maybe (not (sequential? foo)) ?

10:51 rhickey: konr: 'atom' isn't really a first-class abstraction, and was not carried forward into Clojure

10:52 it might have made sense when you only had one composite data structure, but not now

10:59 ambient: does emacs/clojure-mode/slime automatically use java -server?

11:13 neotyk: rhickey: if contribution to clojure-contrib is small do I still have to sign CA?

11:13 rhickey: neotyk: small like what?

11:13 neotyk: like http://github.com/neotyk/clojure-contrib/commit/b70d0c0fd16f6ea6b963fceb39b6d60f1ca55e95

11:15 rhickey: yeah, can't takethat as a patch, but the change is small you might be able to get a contribber to add it just by making a support request

11:16 neotyk: support ticket in assembla?

11:16 rhickey: neotyk: yes

11:16 neotyk: rhickey: thanks!

11:16 rhickey: https://www.assembla.com/spaces/clojure-contrib/support/tickets

11:22 neotyk: created https://www.assembla.com/spaces/clojure-contrib/support/tickets/37-Include-math-lcm-for-more-than-2-args

11:22 arbscht: rhickey: btw, I mailed out a CA ~2 weeks ago - have you received it?

11:23 rhickey: arbscht: I was away in Denmark and haven't checked the PO Box since then.

11:23 arbscht: ah

11:23 rhickey: will soon

11:23 arbscht: great, thanks

11:34 ambient: (time (doseq [i (range 88000)] (aset abuf i (byte (rem i 127)))))

11:34 "call to aset can't be resolved"

11:34 when abuf is Byte/TYPE

11:37 that whole thing takes 4 seconds :/

11:40 Chousuke: you need to typehint abuf

11:40 #^bytes should work I think

11:40 ambient: tried (aset #^bytes abut ... made no difference

11:41 Chousuke: hmmh

11:41 ambient: aaa (aset #^bytes abuf (int i) ,,,) :)

11:42 hah, from 4328 msec to 65 msec :D

11:42 Chousuke: heh

12:02 solussd: specifically, how to I add a path to my environment in emacs that will show up in (.. System getProperties (get "java.class.path")) ?

12:02

12:03 ambient: (setq swank-clojure-extra-classpaths (list "c:/stuff/here" ... ))

12:04 tomoj: solussd: when you're in the minibuffer swank-clojure-project gives you, what does C-h k RET say?

12:05 (if you do this you will need to C-x o back into the minibuffer to C-g it)

12:05 it should be ido-exit-minibuffer

12:05 solussd: RET runs the command newline

12:05 which is an interactive compiled Lisp function in `simple.el'.

12:05 It is bound to RET.

12:06 tomoj: sounds like your ido is broken

12:06 maybe try installing it for real?

12:07 solussd: Oh boy.. C-g does not kill my minibuffer. :(

12:07 tomoj: you have to C-x o into it

12:07 solussd: I did.

12:07 tomoj: if even that doesn't work.. how'd you get out of the minibuffer before?

12:07 solussd: i killed emacs. :)

12:07 tomoj: damn

12:07 something is seriously wrong

12:07 solussd: i ust nuked everything and reinstalled...

12:08 *just

12:08 well... everything being clojure stuff. not emacs

12:08 I'm running in osx

12:08 tomoj: I recommend the emacs-starter-kit

12:08 solussd: What all comes in this starter kit?

12:09 tomoj: lots of stuff

12:09 I had clojure/slime working fine in aquamacs with the starter kit

12:09 Dawgmatix: is there an equivalent to room in lisp ?

12:10 tomoj: didn't try it without the starter kit, though, so I dunno if it will solve your problem

12:10 Dawgmatix: (ie a function to monitor current memory usage)

12:13 tomoj: Dawgmatix: there's jconsole..

12:14 you can get info about memory usage in general from some java class, but not broken down by objects

12:33 djpowell: cool. got my live-repl thing working. It uses the Java Attach API to connect to any running Java process and gives you a clojure repl into it.

12:33 i'll stick it on github once i've figured git out. in the meantime: http://djpowell.net/tmp/liverepl.zip

12:34 quite fun to use it to repl into a repl, so you've got two repls on the same vm. good for testing out concurrency stuff.

12:41 AWizzArd: Slime users: is it possible to autocomplete names of jvm methods?

12:42 ambient: C-c I lists all class methods

13:07 triyo: Saw this article popup on HNews http://www.cio.com.au/article/314348/introduction_clojure and is it me or are the code snippets bad examples of what clojure code should look like. Code clojure code doesn't look like that :)

13:08 Ending parens on separate lines. Error handling by throwing java.lang.Exception in functions...

13:11 solussd: Wtomoj: I installed emacs-starter-kit, installed clojure via package-list-packages and then ran clojure-install and everything worked! ... until I restarted emacs. When I added "(clojure-slime-config)" to my .emacs.el it errors out on it. any ideas?

13:12 *tomoj

13:18 triyo: ,*clojure-version*

13:18 clojurebot: {:interim true, :major 1, :minor 1, :incremental 0, :qualifier "alpha"}

13:20 jlilly: solussd: an error would help, fwiw.

13:22 solussd: jlilly: An error has occurred while loading `/Users/solussd/.emacs.el':

13:22 Symbol's function definition is void: clojure-slime-config

13:24 jlilly: looks like you are missing clojure + slime or w/e provides that function.

13:25 solussd: have you done something akin to (require 'clojure-mode) or w/e?

13:51 solussd: jlilly: slime works for me after installing clojure+slime+swank using 'M-x clojure-install'. after the install it tells me to put (clojure-slime-config) in my .emacs file, but when I restart emacs I get that error

14:47 fyi: If you configure clojure from the emacs-starter-kit (install clojure-mode with package-install -> install clojure with clojure-install, etc) the command (clojure-slime-config "~/src/") needs to be in ~/emacs.d/<username>.el where ~/src is your clojure installation path. I had to explicitly provide the path, despite it being the default.

14:50 "hacks and glory await!" -says the repl. :)

14:54 ankou: hi, how can I pass a clojurefunction with paramters to java?

14:54 Lau_Jensen: (-> #(foo 1 23 3) Thread. .start) for instance

14:55 ankou: this wasn't an answer to my question, was it?

14:55 Lau_Jensen: foo is the clojure function, numbers are param

14:55 I thought I answered it anyway :)

14:57 ankou: you missunderstood me. As far as I know all clojurefunctionvalues implement runnable/callable, right? But what if I want to write a javafunction that takes a clojure-function as a parameter but then needs to call it with arguments

14:58 Lau_Jensen: right.. then that's more of a java question, so I have to hide

15:00 hiredman: ankou: IFn.java

15:00 that defines the interface for clojure functions

15:01 ankou: is there a documentation or do I really have to look at the source?

15:01 Chousuke: no javadoc, unfortunately :(

15:02 it's an open ticket.

15:02 ankou: but it's not likely to change so soon as an implementation detail, is it?

15:02 Chousuke: You'll need to ask rhickey about that.

15:03 hiredman: if you use 1.0 it won't

15:03 spuz: Hey, would someone like to code review my first program? :) http://github.com/alexspurling/clojure-projects/blob/master/Mandelbrot/src/mandelbrot.clj

15:05 It's a fractal renderer. LauJensen, some inspiration taken from your blog posts ;)

15:05 LauJensen: uuuh I must see :)

15:05 spuz, it's funny I was actually thinking of doing a blogpost on 2 - 3 fractals

15:06 spuz: LauJensen: Heh, cool. That would be good to see. I'm sure my implementation could be improved. It's several orders magnitude slower than a pure java implementation

15:07 LauJensen: oh

15:07 serp_: I just get a black JFrame

15:07 oh there we go

15:07 pretty <3

15:07 LauJensen: Ah yes I see that

15:07 spuz, you should check out my post "Brians Transient Brain" and optimize accordingly

15:07 Chousuke: serp_: that looks pretty good.

15:07 spuz: Yeah I was planning to look at that

15:07 LauJensen: You'll get 400% performance

15:07 spuz: hmm ok

15:07 serp_: Chousuke: *points at spuz*

15:08 Chousuke: oh, heh.

15:08 it's probably not very fast but at least it's functional

15:08 DapperDan: LauJensen: I loved you Brian's Brain posts. Great work.

15:09 s/you/your/

15:09 LauJensen: DapperDan, thanks a lot :)

15:09 serp_: Chousuke: *points at spuz*

15:09 LauJensen: spuz, I think the code looks really good, you factor out more stuff than I do, but that's not necessarily a bad thing :D

15:09 serp_: oops wrong window

15:10 spuz: I'm not sure the best way to get it to display rendering progress, one way is to set up a TimerTask to call the repaint method every 50 ms

15:10 Chousuke: spuz: you should maybe name the global defs using the *foo* convention, so that the reader can differentiate them from local variables easier

15:10 spuz: but it's a bit ugly, an alternative is to repaint the window within the function that also renders the fractal

15:11 Chousuke: you mean surround them with *s?

15:11 Chousuke: yeah.

15:11 spuz: ok

15:11 LauJensen: spuz, you really should check out that follow up post :)

15:12 spuz: I was wondering whether it is better practice to put most of those global values such as window sizes, number of iterations as function parameters

15:12 I guess that would be more 'pure'

15:13 LauJensen: I've already taken a look at it, just wondering how to incorporate those ideas into this kind of program. Like you I wanted to start with something that was 'functional' and then figure out the optimisations

15:13 steiger: hello guys.

15:13 LauJensen: spuz, the transient version is still functional, but I really wanted you to see the doublebuffering type-hinted graphics optimizations

15:14 those will get you a long ways in a few lines

15:14 spuz: LauJensen: but how does double buffering help with a static rendered image?

15:14 there's no animation here

15:14 LauJensen: read it, you'll see

15:16 spuz: ok :)

15:17 serp_: I want four numbers... 0 1 2 3. please help :) (take 4 (???))

15:17 DapperDan: serp_: range

15:17 serp_: ah great

15:17 thanks

15:17 DapperDan: i think, i'm at similar level of clojure to you

15:17 serp_: range worked

15:17 ,(range 4)

15:17 clojurebot: (0 1 2 3)

15:18 DapperDan: ,(take (range 4))

15:18 clojurebot: java.lang.IllegalArgumentException: Wrong number of args passed to: core$take

15:18 LauJensen: ,(take 4 (iterate inc 1))

15:18 clojurebot: (1 2 3 4)

15:18 LauJensen: DapperDan, yours is missing an argument

15:18 DapperDan: ,(take 4 (range 4))

15:18 clojurebot: (0 1 2 3)

15:18 DapperDan: the clojurebot is nice

15:19 serp_: indeed

15:19 DapperDan: it would be nice to write a clojurebot for google wave

15:20 serp_: let's say I want (0 0.25 0.5 0.75) instead... is there a smarter way than (apply #(/ %1 4) (range 4)) ?

15:20 ,(apply #(/ %1 4) (range 4))

15:20 clojurebot: java.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$eval--3591$fn

15:20 serp_: :(

15:20 LauJensen: (take 4 (iterate #(+ 0.25 %) 0))

15:21 serp_: hm ofc

15:21 DapperDan: (take 4 (iterate #(+ 0.25 %) 0))

15:21 ,(take 4 (iterate #(+ 0.25 %) 0))

15:21 clojurebot: (0 0.25 0.5 0.75)

15:22 serp_: I guess it takes some time to adjust to the correct way of thinking

15:22 DapperDan: where is the code for the clojurebot?

15:22 LauJensen: clojurebot: where are you ?

15:22 clojurebot: http://github.com/hiredman/clojurebot/tree/master

15:26 serp_: ok last newb question for a while... I would like to generate ((0 0) (0 0.25) (0 0.5) (0 0.75) (0.25 0) (0.25 0.25) (0.25 0.5) (0.25 0.75) ...etc...)

15:27 DapperDan: ,(def nums take 4 (iterate #(+ 0.25 %) 0)))

15:27 clojurebot: DENIED

15:28 triyo: clojurebot doesn't allow "def"

15:29 to state the obvious :)

15:29 DapperDan: i thought it would be worth a try, but too good to be true. :)

15:30 waiting for macports to build so i can write clojure.

15:43 moah: <F8>/part

15:45 LauJensen: DapperDan, pop in a Jaunty CD, it'll be faster :)

15:50 snowwhite: pinh

15:50 *ping

15:51 Have any body tried JSWAT with clojure?

15:53 serp_: ,(length [1 2])

15:53 clojurebot: java.lang.Exception: Unable to resolve symbol: length in this context

15:54 serp_: ,(size [1 2])

15:54 clojurebot: java.lang.Exception: Unable to resolve symbol: size in this context

15:54 serp_: ,(count [1 2])

15:54 clojurebot: 2

15:54 serp_: aight

15:56 LauJensen: snowwhite, yea, quite some time ago

15:56 snowwhite: LauJensen, is it useful?

15:57 LauJensen: Well, I felt it was useful, I profiled an app which turned out to be spending way too much time in transactions, so I knew where to rework the logic

15:57 jvisualvm is easier though and that'll tell you the same thing

15:58 snowwhite: LauJensen, nice

16:03 LauJensen, Any other debugger you want to suggest?

16:04 LauJensen: nope, but note though if you are in Linux you already have jvisualvm, it's just not on your path

16:06 snowwhite: LauJensen, amazing. How can i set and use that with my clojure project?

16:07 LauJensen: well you fire up your program, and when it's running you'll see "Clojure.main" pop up on the main window of jvisualvm, double click that, and you're profiling :)

16:10 serp_: .raw join #code.se

16:10 snowwhite: LauJensen, hmm

16:12 spuz: snowwhite: VisualVM is a good profiler, the eclipse plugin for clojure can be used for debugging

16:12 snowwhite: spuz, I use emacs.

16:12 LauJensen, It seems i don't have jvisualvm?

16:13 LauJensen, I fired from my terminal but didn't work?

16:14 LauJensen: didn't work = ?

16:15 what does 'locate jvisualvm' give you ?

16:15 snowwhite: LauJensen, Nothing

16:17 LauJensen: OS ?

16:17 snowwhite: Gnu/Linux (Ubuntu 8.04)

16:20 LauJensen: try 'aptitude search jdk'

16:21 is sun's installed? (ie does the line start with an 'i')

16:22 snowwhite: LauJensen, i have JDK

16:23 LauJensen: weird

16:23 snowwhite: LauJensen, It seems i have to install visualvm?

16:23 LauJensen: sudo updatedb && locate jvisualvm

16:23 snowwhite: LauJensen, I am doing that now

16:23 LauJensen: snowwhite, no, it should be part of the package

16:23 snowwhite: LauJensen, hmm

16:23 LauJensen: /usr/lib/jvm/java-6-sun-1.6.0.16/bin/jvisualvm

16:25 snowwhite: LauJensen, checked /usr/lib/jvm/java-6-sun-1.6.0.10/bin/ Doesn't have jvisualvm inside bin

16:26 Chousuke: you need a newer java

16:26 LauJensen: Did you cleverly partition your drive having / separate from /home/ ?

16:26 snowwhite: LauJensen, of course i did

16:26 LauJensen, It seems i have a bit older version of JAVA

16:26 LauJensen: snowwhite, so you could quite quickly install Jaunty or Karmic beta?? *hint* *hint*

16:27 Like Chousuke says you want 1.6.0.16

16:27 snowwhite: LauJensen, yes

16:29 Chousuke: your version of ubuntu is rather old :P

16:30 snowwhite: Chousuke, Yes, right. I planned to directly move to 9.10

16:30 Chousuke: upgrading more than one version at once might not be safe though :/

16:30 LauJensen: That's 12 days out :)

16:31 snowwhite: Sorry, i have 8.10

16:32 ChanServ, Right, i will install it fresh on my machine.

16:32 Chousuke, , Right, i will install it fresh on my machine.

16:32 Chousuke, LauJensen Meanwhile, any other solution :)

16:32 konr: How does On Lisp compare to Let Over Lambda?

16:33 snowwhite: Konr ?

16:33 konr: snowwhite: two books

16:33 LauJensen: snowwhite, JSwat

16:34 konr: snowwhite: oh, let me check your question

16:34 snowwhite: konr, I have read On lisp. that's a good book.

16:35 konr, sorry, No idea about let over lambda

16:36 LauJensen, ok. Thank you very much for your helpful suggestions. :)

16:37 LauJensen: np

16:51 somnium: let-over-lambda looks interesting, but I suspect the chapter on reader macros won't have much application in clojure

17:01 lisppaste8: maacl pasted "alter and let" at http://paste.lisp.org/display/88809

17:02 maacl: Why does http://paste.lisp.org/display/88809 return an unaltered version of v?

17:02 Chousuke: map is lazy

17:03 but to be honest, that seems very wrong

17:04 tomoj: good

17:04 I'm glad it's not just me thinking that's wrong

17:04 maacl: Chousuke: I know, it is just an example I am using to figure it out

17:06 Instead of dumping on my example could someone explain what it is I am missing.

17:06 Chousuke: map is lazy :)

17:06 you never actually call the flip function

17:06 hiredman: because the result of the map is never forced

17:07 Chousuke: but why is it like that anyway? are you trying to ensure that no-one changed the ref in between the derefs? :/

17:08 maacl: It is an example I wrote to understand why the change wasn't taking place.

17:09 Chousuke: well, hopefully you understand now :P

17:18 LauJensen: Chousuke, he has a good point though - We tend to 'dump on examples' when we actually mean 'that doesn't look idiomatic' or something similar.

17:19 mccraig: what's a good way to evaluate a list of functions returning boolean results using 'and' logic... i.e. stop after the first false result ?

17:20 LauJensen: take-while ?

17:21 Chousuke: hmm

17:21 ,(map apply [+ *])

17:21 technomancy: mccraig: (reduce #(and %1 (%2)) [fn1 fn2 fn3])

17:21 clojurebot: java.lang.IllegalArgumentException: Wrong number of args passed to: core$apply

17:21 technomancy: reduce is my hammer. =)

17:21 Chousuke: heh

17:22 reduce doesn't stop at the first false though

17:22 it won't call the functions but it'll still go through the whole list. :P

17:22 technomancy: yeah, it's wasteful

17:23 mccraig: and will get called, but the remaining args will not be evaluated...

17:23 technomancy: depending on how long the fn1 etc functions take you might not care

17:24 Chousuke: (every? (map (fn [f] (f)) fns)) will be completely lazy

17:24 hm

17:24 needs identity I guess

17:25 mccraig: yeah, it's a short list, and reducing with "and" makes the intent clear

17:27 ordnungswidrig: hi, slime is eating the "caused by"s of an exception. Is there any way to have slime show them?

17:29 technomancy: ordnungswidrig: eating or just not showing them right off the bat?

17:30 ordnungswidrig: technomancy: the are not shown in the slime sldb backtrace. especially the cause of a ExceptionInInitializerError which I suppose is in my casue due to a missing dependency

17:31 technomancy: ordnungswidrig: and it doesn't give you an option to press 1 to show them?

17:32 ordnungswidrig: technomancy: do you now the sound, when one bangs one's head against the table?

17:32 technomancy: it's the perfect moment to imagine

17:32 * ordnungswidrig bangs his head on one the table

17:33 technomancy: ordnungswidrig: heh... yeah. I'm not super-happy with the way the backtraces work

17:34 better than they used to be though

17:34 ordnungswidrig: technomancy: aha, the second time a NoClassDef is thrown and no cause given

17:34 technomancy: but its a slime related issue, I suppose

17:35 neotyk: how do you guys work with clojure code? vim/emacs/ide?

17:35 ordnungswidrig: emacs with vi emulation

17:36 technomancy: ordnungswidrig: you shouldn't expect a cause on a No Class Def

17:37 ordnungswidrig: ordnungswidrig: yes, the first time a ExceptionInitializerError is thrown caused by a ClassNotFoundException.

17:38 when I try to load the same package again, a NoClassDef is thrown

17:38 I think this is because of the classloader caching the first trial's result

17:40 /whois technomancy

17:41 hmmm...

17:55 somnium: is there a way to list every available class on the classpath?

18:03 hiredman: nope

18:03 somnium: bummer

18:03 neotyk: why would you care?

18:03 hiredman: "is there a way to list every available shared library?"

18:04 neotyk: you get 295 classes loaded just to boot jvm

18:05 somnium: just kicking around some ideas based on inspecting the environment

18:06 hiredman: holy crap

18:06 somnium: ?

18:06 hiredman: someone opened an issue on one of my github repos

18:06 neotyk: somnium: start sould be http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ClassLoader.html#getPackages()

18:07 somnium: or not :P

18:12 somnium: how to get the repl's class loader?

18:13 hiredman: clojure keeps it's classloader in RT somewhere

18:14 somnium: RT?

18:14 LauJensen: Is there anything in core that will let me slurp a website?

18:15 hiredman: ~def c.l.RT

18:15 ,(doc slupr)

18:15 clojurebot: It's greek to me.

18:15 hiredman: ,(doc slrpr)

18:15 clojurebot: I don't understand.

18:15 hiredman: bah

18:15 ,(doc slurp)

18:15 somnium: ,(.getClassLoader clojure.main)

18:15 clojurebot: "([f] [f enc]); Reads the file named by f using the encoding enc into a string and returns it."

18:15 java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)

18:16 hiredman: ~def slurp

18:19 ,(RT/baseLoader)

18:19 clojurebot: java.lang.Exception: No such namespace: RT

18:19 hiredman: bah

18:19 ,(import '(clojure.lang RT))

18:19 clojurebot: clojure.lang.RT

18:19 hiredman: ,(RT/baseLoader)

18:19 clojurebot: #<DynamicClassLoader clojure.lang.DynamicClassLoader@178986b>

18:21 hiredman: LauJensen: clojure.xmp/parse can take a url, but it has to be proper xml

18:22 LauJensen: It's not though, just text

18:23 licoresse: Can I see the sourcecode of a function at the repl, in the same way that I can fetch meta-data?

18:24 hiredman: http://github.com/hiredman/clojurebot/blob/d92e697abdf9ef2b6dc015665f597442c2cf0f3c/hiredman/utilities.clj has a get-url function

18:24 licoresse: no

18:25 licoresse: ok

18:25 hiredman: there is a source function somewhere in contrib, but that relies on the source for the function being accessable on the filesystem

18:26 licoresse: hiredman: yes, I'll look at it, thx

18:26 hiredman: actually, I think there is a better get-url pastebin'ed somewhere

18:26 somnium: get-source in repl-utils

18:26 licoresse: somnium: spot on!

18:27 somnium: ah, actually source is better, it prints it for you, get-source returns a string

18:27 licoresse: happened to be using it right now

18:27 licoresse: heh

18:29 ankou: does anybody know how to use AOT compilation with enclojure?

18:32 licoresse: when in the repl in emacs, can I go (in history) to a command that matches partially the one I have right now?

18:33 technomancy: licoresse: M-p should do that

18:34 licoresse: technomancy: it does, but when in paredit-mode, it won't

18:34 (if you see my point)

18:34 technomancy: licoresse: because the closing paren prevents it from being a partial match

18:34 licoresse: yes

18:34 technomancy: you can kill the close paren with M-w; I don't know a better way around it.

18:35 licoresse: not when in paredit

18:35 at least not here :/

18:36 somnium: licoresse: you can turn off paredit in the repl-buffer

18:36 licoresse: somnium: I know

18:37 (and I don't know how to live without :-)

18:37 somnium: set up some new bindings in .emacs then?

18:37 licoresse: just did

18:38 a f-key toggles the mode

18:38 somnium: nice

18:38 licoresse: s/a/an

18:38 yes, nice

18:39 anyone with clozure experience?

18:39 I was thinking about testing it for real mac os apps

18:40 * licoresse wish for a clo(j)ure connected to the obj-c runtime

18:40 * licoresse ala f-script

19:24 technomancy: licoresse: you can use M-w to kill parens even if paredit is enabled

19:24 it's like a way to break out of paredit's rules

19:25 licoresse: technomancy: then I need to investigate why it won't here. Probably something that needs an update somewhere :-/

19:27 hiredman: huh

19:27 youtube is pure python, go figure

19:35 tomoj: even the video processing?

19:36 hiredman: dunno, the google guy giving the unladen swallow presentation at the llvm conf said "pure ruby"

19:37 er

19:37 pardon

19:37 pure python

20:53 gilbertleung: hi

20:54 suppose i have 3 functions i don't mind users seeing, but each of them share a helper function that I don't want users to see.... is there anyway i could "hide" that helper function?

20:55 that is... limit the helper function to this one file only

20:59 licoresse: defn- perhaps?

20:59 gilbertleung: ...

21:00 gilbertleung: licoresse: nice, thanks

23:47 jlilly: how do you update the value of a variable?

23:47 hiredman: you don't

23:48 durka42: unless it's a reference type

23:48 hiredman: durka42: shhh

23:48 tell people that and they will use atoms everywhere

23:48 best just tell them it's not possible

23:50 jlilly: heh.

23:50 right. so I'm making a guess by number game.

23:51 I need to update the guess so I can check to see if its right.

23:51 hiredman: user iterate

23:51 use

23:52 durka42: or loop/recur

23:53 hiredman: (fn [x] (if (= x guessed_number) :win (get_guess)))

23:54 (take-while (partial not= :win) (itreate that-fn (get-guess)))

23:56 durka42: ,(doc iterate)

23:56 clojurebot: "([f x]); Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects"

23:57 hiredman: hmmm

23:57 ~def iterate

23:58 that is unfortunate

Logging service provided by n01se.net