#clojure logs

2009-10-17

00:22jaiganeshhi
00:23durka42hi jaiganesh
00:23jaiganeshhow can i split a string of this format "\"DARELL\",\"BRODERICK\",\"ALONSO\""
00:23jaiganeshinto a list
00:24durka42,(seq (.split "\"DARELL\",\"BRODERICK\",\"ALONSO\"" ","))
00:24durka42oops, we are botless
00:24durka42that gives you ("\"DARELL\"" "\"BRODERICK\"" "\"ALONSO\"")
00:25jaiganeshn how to remove \
00:25arbschtand there is (split s re) in c.c.str-utils2
00:26durka42user=> (map #(.substring % 1 (dec (.length %))) *1)
00:26durka42("DARELL" "BRODERICK" "ALONSO")
00:29jaiganeshdurka42:interesting, what is *1
00:29durka42(require '[clojure.contrib.str-utils2 :as s]) (remove empty? (s/split "\"DARELL\",\"BRODERICK\",\"ALONSO\"" #"[\",]"))
00:30durka42*1 is the previous value from the REPL
00:30jaiganeshk
00:30durka42^ using the function arbscht pointedo ut
00:31jaiganeshTHANKS
00:31arbscht(map #(-> % (ss/drop 1) (ss/butlast 1)) ...)
00:34arbschtor (map #(-> % (ss/drop 1) (ss/chop)) ...)
00:35arbschtI wonder why the trim functions don't take an optional character or character-class argument
00:36durka42agreed
00:37arbscht(map #(ss/replace % #"(^\"|\"$)" "") ...)
00:37durka42> (s/replace "\"blah\"" #"^\"+(.*)\"+$" "$1")
00:37durka42"blah"
00:38arbscht(map #(ss/replace % #"(^\"+|\"+$)" "") ...)
00:39arbschtbah, no clojurebot to remind us of the evil of regex :)
00:39jaiganesh:)
00:41durka42(defn strip [st chars] (ss/replace st (re-pattern (str "^[" pat "]*(.*)[" pat "]*$")) "$1"))
00:42durka42oops, (defn strip [st chars] (s/replace st (re-pattern (str "^[" chars "]*(.*?)[" chars "]*$")) "$1"))
00:49solussdI have emacs configured with 'clojure-install'. How do I add a path to my classpath?
01:03tomojsolussd: there's swank-clojure-classpath
01:03tomojI prefer using swank-clojure-project
01:04tomojjust 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
01:04tomojthough you need to stick copies of clojure.jar and clojure-contrib.jar in there too
01:05tomojand with that method you have to restart the repl (or do something funky I don't know about) if you add a jar
01:05solussdawesome- thanks
01:06tomojyou 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
01:12somniumyou can just put the path to your clojure and contrib jars in the clojure-project source
01:13somniumI modified it to grab some extra jars for app engine stuff
01:22hiredmanwell, clojurebot includes a mini webserver now :(
01:26tomojwhere is it?
01:28hiredmanhttp://gist.github.com/212251
01:28hiredmanfor querying factoids via json
01:29hiredmanstill a few debug prn statements
02:17hiredmanhttp://www.thelastcitadel.com/lab/clojurebot.html <-- javascript pulling factiods from clojurebot
02:49tomojhas anyone gotten a remote slime repl to work with tramp?
02:50tomojit seems to me that swank-clojure is not providing enough information about the connection for slime-tramp.el to work
06:31LauJensenMorning gents
06:50ambientmorning
06:53sfuentesGoodnight over here :)
07:13LauJensenWell it's noon + 1 here actually, but it feel strangely like morning, just seconds before the coffee kicks in :)
10:00solussdIf 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:00tomoj"another line"?
10:00tomojit's supposed to start a repl
10:01Chousukeas in, instead of sending the command you get a newline?
10:01Chousukeweird
10:01solussdYes.
10:02Dawgmatixare there any plans to add swank-clojure to upstream slime ?
10:02Chousukeit's probably easier to develop as a separate project :P
10:02solussdI installed everything using m-x clojure-install
10:03Chousukethe slime people use CVS :(
10:05konrIs there a function to find out if an element is NOT a sequence, like (not (list? "foo"))?
10:06konror (not (seq? "foo"))
10:09solussdAll 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:17tomojsolussd: you mean a newline appears in the minibuffer?
10:17solussdyes
10:17tomojthat's very odd
10:17solussdI thought so. :)
10:18solussdtrying to make my way through the clojure book.. stuck until I can define my lib path
10:20tomojare you using the emacs-starter-kit?
10:21solussdno, just emacs/aquamacs. I installed all the clojure stuff using M-x clojure-install
10:22solussd*aquaemacs
10:22solussd*aquamacs emacs? :)
10:23tomojhmm
10:24tomojI've always had ido-mode when using swank-clojure-project
10:24tomojI would think it should work without it, though..
10:25ericthorsen_er
10:25namor"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:26tomojI think they're specifically talking about mutating some data
10:26arbschtnamor: that may be better worded as "In Clojure, mutation is explicit and unusual"
10:26namorYes, that makes more sense.
10:29tomojhmm, does emacs come with ido by default?
10:29ambientnot mine at least
10:29ambientinstalled separately
10:29ambienti find it very hard to do side effects in idiomatic clojure :P
10:30tomojsolussd: do C-h f ido-read-directory-name
10:32solussdi get a seperate buffer with this: do-read-directory-name is an autoloaded Lisp function in `ido'.
10:32solussd(ido-read-directory-name prompt &optional dir default-dirname
10:32solussdmustmatch initial)
10:33tomojguess you have it then
10:34tomojwell.. if all else fails you can just manually set swank-clojure-classpath, I guess
10:35tomojdunno what would cause the interactive arg not to work
10:40solussdHow do I 'append' to swank-clojure-classpath ?
10:40solussdI've tried a few ways, but none seem to work
10:47konrwhat is the clojure equivalent of CL's (atom foo)?
10:51tomojmaybe (not (sequential? foo)) ?
10:51rhickeykonr: 'atom' isn't really a first-class abstraction, and was not carried forward into Clojure
10:52rhickeyit might have made sense when you only had one composite data structure, but not now
10:59ambientdoes emacs/clojure-mode/slime automatically use java -server?
11:13neotykrhickey: if contribution to clojure-contrib is small do I still have to sign CA?
11:13rhickeyneotyk: small like what?
11:13neotyklike http://github.com/neotyk/clojure-contrib/commit/b70d0c0fd16f6ea6b963fceb39b6d60f1ca55e95
11:15rhickeyyeah, 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:16neotyksupport ticket in assembla?
11:16rhickeyneotyk: yes
11:16neotykrhickey: thanks!
11:16rhickeyhttps://www.assembla.com/spaces/clojure-contrib/support/tickets
11:22neotykcreated https://www.assembla.com/spaces/clojure-contrib/support/tickets/37-Include-math-lcm-for-more-than-2-args
11:22arbschtrhickey: btw, I mailed out a CA ~2 weeks ago - have you received it?
11:23rhickeyarbscht: I was away in Denmark and haven't checked the PO Box since then.
11:23arbschtah
11:23rhickeywill soon
11:23arbschtgreat, thanks
11:34ambient(time (doseq [i (range 88000)] (aset abuf i (byte (rem i 127)))))
11:34ambient"call to aset can't be resolved"
11:34ambientwhen abuf is Byte/TYPE
11:37ambientthat whole thing takes 4 seconds :/
11:40Chousukeyou need to typehint abuf
11:40Chousuke#^bytes should work I think
11:40ambienttried (aset #^bytes abut ... made no difference
11:41Chousukehmmh
11:41ambientaaa (aset #^bytes abuf (int i) ,,,) :)
11:42ambienthah, from 4328 msec to 65 msec :D
11:42Chousukeheh
12:02solussdspecifically, how to I add a path to my environment in emacs that will show up in (.. System getProperties (get "java.class.path")) ?
12:02solussd
12:03ambient(setq swank-clojure-extra-classpaths (list "c:/stuff/here" ... ))
12:04tomojsolussd: when you're in the minibuffer swank-clojure-project gives you, what does C-h k RET say?
12:05tomoj(if you do this you will need to C-x o back into the minibuffer to C-g it)
12:05tomojit should be ido-exit-minibuffer
12:05solussdRET runs the command newline
12:05solussd which is an interactive compiled Lisp function in `simple.el'.
12:05solussdIt is bound to RET.
12:06tomojsounds like your ido is broken
12:06tomojmaybe try installing it for real?
12:07solussdOh boy.. C-g does not kill my minibuffer. :(
12:07tomojyou have to C-x o into it
12:07solussdI did.
12:07tomojif even that doesn't work.. how'd you get out of the minibuffer before?
12:07solussdi killed emacs. :)
12:07tomojdamn
12:07tomojsomething is seriously wrong
12:07solussdi ust nuked everything and reinstalled...
12:08solussd*just
12:08solussdwell... everything being clojure stuff. not emacs
12:08solussdI'm running in osx
12:08tomojI recommend the emacs-starter-kit
12:08solussdWhat all comes in this starter kit?
12:09tomojlots of stuff
12:09tomojI had clojure/slime working fine in aquamacs with the starter kit
12:09Dawgmatixis there an equivalent to room in lisp ?
12:10tomojdidn't try it without the starter kit, though, so I dunno if it will solve your problem
12:10Dawgmatix(ie a function to monitor current memory usage)
12:13tomojDawgmatix: there's jconsole..
12:14tomojyou can get info about memory usage in general from some java class, but not broken down by objects
12:33djpowellcool. 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:33djpowelli'll stick it on github once i've figured git out. in the meantime: http://djpowell.net/tmp/liverepl.zip
12:34djpowellquite 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:41AWizzArdSlime users: is it possible to autocomplete names of jvm methods?
12:42ambientC-c I lists all class methods
13:07triyoSaw 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:08triyoEnding parens on separate lines. Error handling by throwing java.lang.Exception in functions...
13:11solussdWtomoj: 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:12solussd*tomoj
13:18triyo,*clojure-version*
13:18clojurebot{:interim true, :major 1, :minor 1, :incremental 0, :qualifier "alpha"}
13:20jlillysolussd: an error would help, fwiw.
13:22solussdjlilly: An error has occurred while loading `/Users/solussd/.emacs.el':
13:22solussdSymbol's function definition is void: clojure-slime-config
13:24jlillylooks like you are missing clojure + slime or w/e provides that function.
13:25jlillysolussd: have you done something akin to (require 'clojure-mode) or w/e?
13:51solussdjlilly: 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:47solussdfyi: 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:50solussd"hacks and glory await!" -says the repl. :)
14:54ankouhi, how can I pass a clojurefunction with paramters to java?
14:54Lau_Jensen(-> #(foo 1 23 3) Thread. .start) for instance
14:55ankouthis wasn't an answer to my question, was it?
14:55Lau_Jensenfoo is the clojure function, numbers are param
14:55Lau_JensenI thought I answered it anyway :)
14:57ankouyou 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:58Lau_Jensenright.. then that's more of a java question, so I have to hide
15:00hiredmanankou: IFn.java
15:00hiredmanthat defines the interface for clojure functions
15:01ankouis there a documentation or do I really have to look at the source?
15:01Chousukeno javadoc, unfortunately :(
15:02Chousukeit's an open ticket.
15:02ankoubut it's not likely to change so soon as an implementation detail, is it?
15:02ChousukeYou'll need to ask rhickey about that.
15:03hiredmanif you use 1.0 it won't
15:03spuzHey, would someone like to code review my first program? :) http://github.com/alexspurling/clojure-projects/blob/master/Mandelbrot/src/mandelbrot.clj
15:05spuzIt's a fractal renderer. LauJensen, some inspiration taken from your blog posts ;)
15:05LauJensenuuuh I must see :)
15:05LauJensenspuz, it's funny I was actually thinking of doing a blogpost on 2 - 3 fractals
15:06spuzLauJensen: 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:07LauJensenoh
15:07serp_I just get a black JFrame
15:07serp_oh there we go
15:07serp_pretty <3
15:07LauJensenAh yes I see that
15:07LauJensenspuz, you should check out my post "Brians Transient Brain" and optimize accordingly
15:07Chousukeserp_: that looks pretty good.
15:07spuzYeah I was planning to look at that
15:07LauJensenYou'll get 400% performance
15:07spuzhmm ok
15:07serp_Chousuke: *points at spuz*
15:08Chousukeoh, heh.
15:08Chousukeit's probably not very fast but at least it's functional
15:08DapperDanLauJensen: I loved you Brian's Brain posts. Great work.
15:09DapperDans/you/your/
15:09LauJensenDapperDan, thanks a lot :)
15:09serp_Chousuke: *points at spuz*
15:09LauJensenspuz, 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:09serp_oops wrong window
15:10spuzI'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:10Chousukespuz: you should maybe name the global defs using the *foo* convention, so that the reader can differentiate them from local variables easier
15:10spuzbut it's a bit ugly, an alternative is to repaint the window within the function that also renders the fractal
15:11spuzChousuke: you mean surround them with *s?
15:11Chousukeyeah.
15:11spuzok
15:11LauJensenspuz, you really should check out that follow up post :)
15:12spuzI 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:12spuzI guess that would be more 'pure'
15:13spuzLauJensen: 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:13steigerhello guys.
15:13LauJensenspuz, the transient version is still functional, but I really wanted you to see the doublebuffering type-hinted graphics optimizations
15:14LauJensenthose will get you a long ways in a few lines
15:14spuzLauJensen: but how does double buffering help with a static rendered image?
15:14spuzthere's no animation here
15:14LauJensenread it, you'll see
15:16spuzok :)
15:17serp_I want four numbers... 0 1 2 3. please help :) (take 4 (???))
15:17DapperDanserp_: range
15:17serp_ah great
15:17serp_thanks
15:17DapperDani think, i'm at similar level of clojure to you
15:17serp_range worked
15:17serp_,(range 4)
15:17clojurebot(0 1 2 3)
15:18DapperDan,(take (range 4))
15:18clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: core$take
15:18LauJensen,(take 4 (iterate inc 1))
15:18clojurebot(1 2 3 4)
15:18LauJensenDapperDan, yours is missing an argument
15:18DapperDan,(take 4 (range 4))
15:18clojurebot(0 1 2 3)
15:18DapperDanthe clojurebot is nice
15:19serp_indeed
15:19DapperDanit would be nice to write a clojurebot for google wave
15:20serp_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:20serp_,(apply #(/ %1 4) (range 4))
15:20clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$eval--3591$fn
15:20serp_:(
15:20LauJensen(take 4 (iterate #(+ 0.25 %) 0))
15:21serp_hm ofc
15:21DapperDan(take 4 (iterate #(+ 0.25 %) 0))
15:21DapperDan,(take 4 (iterate #(+ 0.25 %) 0))
15:21clojurebot(0 0.25 0.5 0.75)
15:22serp_I guess it takes some time to adjust to the correct way of thinking
15:22DapperDanwhere is the code for the clojurebot?
15:22LauJensenclojurebot: where are you ?
15:22clojurebothttp://github.com/hiredman/clojurebot/tree/master
15:26serp_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:27DapperDan,(def nums take 4 (iterate #(+ 0.25 %) 0)))
15:27clojurebotDENIED
15:28triyoclojurebot doesn't allow "def"
15:29triyoto state the obvious :)
15:29DapperDani thought it would be worth a try, but too good to be true. :)
15:30DapperDanwaiting for macports to build so i can write clojure.
15:43moah<F8>/part
15:45LauJensenDapperDan, pop in a Jaunty CD, it'll be faster :)
15:50snowwhitepinh
15:50snowwhite*ping
15:51snowwhiteHave any body tried JSWAT with clojure?
15:53serp_,(length [1 2])
15:53clojurebotjava.lang.Exception: Unable to resolve symbol: length in this context
15:54serp_,(size [1 2])
15:54clojurebotjava.lang.Exception: Unable to resolve symbol: size in this context
15:54serp_,(count [1 2])
15:54clojurebot2
15:54serp_aight
15:56LauJensensnowwhite, yea, quite some time ago
15:56snowwhiteLauJensen, is it useful?
15:57LauJensenWell, 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:57LauJensenjvisualvm is easier though and that'll tell you the same thing
15:58snowwhiteLauJensen, nice
16:03snowwhiteLauJensen, Any other debugger you want to suggest?
16:04LauJensennope, but note though if you are in Linux you already have jvisualvm, it's just not on your path
16:06snowwhiteLauJensen, amazing. How can i set and use that with my clojure project?
16:07LauJensenwell 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:10serp_.raw join #code.se
16:10snowwhiteLauJensen, hmm
16:12spuzsnowwhite: VisualVM is a good profiler, the eclipse plugin for clojure can be used for debugging
16:12snowwhitespuz, I use emacs.
16:12snowwhiteLauJensen, It seems i don't have jvisualvm?
16:13snowwhiteLauJensen, I fired from my terminal but didn't work?
16:14LauJensendidn't work = ?
16:15LauJensenwhat does 'locate jvisualvm' give you ?
16:15snowwhiteLauJensen, Nothing
16:17LauJensenOS ?
16:17snowwhiteGnu/Linux (Ubuntu 8.04)
16:20LauJensentry 'aptitude search jdk'
16:21LauJensenis sun's installed? (ie does the line start with an 'i')
16:22snowwhiteLauJensen, i have JDK
16:23LauJensenweird
16:23snowwhiteLauJensen, It seems i have to install visualvm?
16:23LauJensensudo updatedb && locate jvisualvm
16:23snowwhiteLauJensen, I am doing that now
16:23LauJensensnowwhite, no, it should be part of the package
16:23snowwhiteLauJensen, hmm
16:23LauJensen/usr/lib/jvm/java-6-sun-1.6.0.16/bin/jvisualvm
16:25snowwhiteLauJensen, checked /usr/lib/jvm/java-6-sun-1.6.0.10/bin/ Doesn't have jvisualvm inside bin
16:26Chousukeyou need a newer java
16:26LauJensenDid you cleverly partition your drive having / separate from /home/ ?
16:26snowwhiteLauJensen, of course i did
16:26snowwhiteLauJensen, It seems i have a bit older version of JAVA
16:26LauJensensnowwhite, so you could quite quickly install Jaunty or Karmic beta?? *hint* *hint*
16:27LauJensenLike Chousuke says you want 1.6.0.16
16:27snowwhiteLauJensen, yes
16:29Chousukeyour version of ubuntu is rather old :P
16:30snowwhiteChousuke, Yes, right. I planned to directly move to 9.10
16:30Chousukeupgrading more than one version at once might not be safe though :/
16:30LauJensenThat's 12 days out :)
16:31snowwhiteSorry, i have 8.10
16:32snowwhiteChanServ, Right, i will install it fresh on my machine.
16:32snowwhiteChousuke, , Right, i will install it fresh on my machine.
16:32snowwhiteChousuke, LauJensen Meanwhile, any other solution :)
16:32konrHow does On Lisp compare to Let Over Lambda?
16:33snowwhiteKonr ?
16:33konrsnowwhite: two books
16:33LauJensensnowwhite, JSwat
16:34konrsnowwhite: oh, let me check your question
16:34snowwhitekonr, I have read On lisp. that's a good book.
16:35snowwhitekonr, sorry, No idea about let over lambda
16:36snowwhiteLauJensen, ok. Thank you very much for your helpful suggestions. :)
16:37LauJensennp
16:51somniumlet-over-lambda looks interesting, but I suspect the chapter on reader macros won't have much application in clojure
17:01lisppaste8maacl pasted "alter and let" at http://paste.lisp.org/display/88809
17:02maaclWhy does http://paste.lisp.org/display/88809 return an unaltered version of v?
17:02Chousukemap is lazy
17:03Chousukebut to be honest, that seems very wrong
17:04tomojgood
17:04tomojI'm glad it's not just me thinking that's wrong
17:04maaclChousuke: I know, it is just an example I am using to figure it out
17:06maaclInstead of dumping on my example could someone explain what it is I am missing.
17:06Chousukemap is lazy :)
17:06Chousukeyou never actually call the flip function
17:06hiredmanbecause the result of the map is never forced
17:07Chousukebut why is it like that anyway? are you trying to ensure that no-one changed the ref in between the derefs? :/
17:08maaclIt is an example I wrote to understand why the change wasn't taking place.
17:09Chousukewell, hopefully you understand now :P
17:18LauJensenChousuke, 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:19mccraigwhat'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:20LauJensentake-while ?
17:21Chousukehmm
17:21Chousuke,(map apply [+ *])
17:21technomancymccraig: (reduce #(and %1 (%2)) [fn1 fn2 fn3])
17:21clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: core$apply
17:21technomancyreduce is my hammer. =)
17:21Chousukeheh
17:22Chousukereduce doesn't stop at the first false though
17:22Chousukeit won't call the functions but it'll still go through the whole list. :P
17:22technomancyyeah, it's wasteful
17:23mccraigand will get called, but the remaining args will not be evaluated...
17:23technomancydepending on how long the fn1 etc functions take you might not care
17:24Chousuke(every? (map (fn [f] (f)) fns)) will be completely lazy
17:24Chousukehm
17:24Chousukeneeds identity I guess
17:25mccraigyeah, it's a short list, and reducing with "and" makes the intent clear
17:27ordnungswidrighi, slime is eating the "caused by"s of an exception. Is there any way to have slime show them?
17:29technomancyordnungswidrig: eating or just not showing them right off the bat?
17:30ordnungswidrigtechnomancy: 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:31technomancyordnungswidrig: and it doesn't give you an option to press 1 to show them?
17:32ordnungswidrigtechnomancy: do you now the sound, when one bangs one's head against the table?
17:32ordnungswidrigtechnomancy: it's the perfect moment to imagine
17:33technomancyordnungswidrig: heh... yeah. I'm not super-happy with the way the backtraces work
17:34technomancybetter than they used to be though
17:34ordnungswidrigtechnomancy: aha, the second time a NoClassDef is thrown and no cause given
17:34ordnungswidrigtechnomancy: but its a slime related issue, I suppose
17:35neotykhow do you guys work with clojure code? vim/emacs/ide?
17:35ordnungswidrigemacs with vi emulation
17:36technomancyordnungswidrig: you shouldn't expect a cause on a No Class Def
17:37ordnungswidrigordnungswidrig: yes, the first time a ExceptionInitializerError is thrown caused by a ClassNotFoundException.
17:38ordnungswidrigwhen I try to load the same package again, a NoClassDef is thrown
17:38ordnungswidrigI think this is because of the classloader caching the first trial's result
17:40ordnungswidrig/whois technomancy
17:41ordnungswidrighmmm...
17:55somniumis there a way to list every available class on the classpath?
18:03hiredmannope
18:03somniumbummer
18:03neotykwhy would you care?
18:03hiredman"is there a way to list every available shared library?"
18:04neotykyou get 295 classes loaded just to boot jvm
18:05somniumjust kicking around some ideas based on inspecting the environment
18:06hiredmanholy crap
18:06somnium?
18:06hiredmansomeone opened an issue on one of my github repos
18:06neotyksomnium: start sould be http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ClassLoader.html#getPackages()
18:07neotyksomnium: or not :P
18:12somniumhow to get the repl's class loader?
18:13hiredmanclojure keeps it's classloader in RT somewhere
18:14somniumRT?
18:14LauJensenIs there anything in core that will let me slurp a website?
18:15hiredman~def c.l.RT
18:15hiredman,(doc slupr)
18:15clojurebotIt's greek to me.
18:15hiredman,(doc slrpr)
18:15clojurebotI don't understand.
18:15hiredmanbah
18:15hiredman,(doc slurp)
18:15somnium,(.getClassLoader clojure.main)
18:15clojurebot"([f] [f enc]); Reads the file named by f using the encoding enc into a string and returns it."
18:15clojurebotjava.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
18:16hiredman~def slurp
18:19hiredman,(RT/baseLoader)
18:19clojurebotjava.lang.Exception: No such namespace: RT
18:19hiredmanbah
18:19hiredman,(import '(clojure.lang RT))
18:19clojurebotclojure.lang.RT
18:19hiredman,(RT/baseLoader)
18:19clojurebot#<DynamicClassLoader clojure.lang.DynamicClassLoader@178986b>
18:21hiredmanLauJensen: clojure.xmp/parse can take a url, but it has to be proper xml
18:22LauJensenIt's not though, just text
18:23licoresseCan I see the sourcecode of a function at the repl, in the same way that I can fetch meta-data?
18:24hiredmanhttp://github.com/hiredman/clojurebot/blob/d92e697abdf9ef2b6dc015665f597442c2cf0f3c/hiredman/utilities.clj has a get-url function
18:24hiredmanlicoresse: no
18:25licoresseok
18:25hiredmanthere is a source function somewhere in contrib, but that relies on the source for the function being accessable on the filesystem
18:26licoressehiredman: yes, I'll look at it, thx
18:26hiredmanactually, I think there is a better get-url pastebin'ed somewhere
18:26somniumget-source in repl-utils
18:26licoressesomnium: spot on!
18:27somniumah, actually source is better, it prints it for you, get-source returns a string
18:27somniumlicoresse: happened to be using it right now
18:27licoresseheh
18:29ankoudoes anybody know how to use AOT compilation with enclojure?
18:32licoressewhen in the repl in emacs, can I go (in history) to a command that matches partially the one I have right now?
18:33technomancylicoresse: M-p should do that
18:34licoressetechnomancy: it does, but when in paredit-mode, it won't
18:34licoresse(if you see my point)
18:34technomancylicoresse: because the closing paren prevents it from being a partial match
18:34licoresseyes
18:34technomancyyou can kill the close paren with M-w; I don't know a better way around it.
18:35licoressenot when in paredit
18:35licoresseat least not here :/
18:36somniumlicoresse: you can turn off paredit in the repl-buffer
18:36licoressesomnium: I know
18:37licoresse(and I don't know how to live without :-)
18:37somniumset up some new bindings in .emacs then?
18:37licoressejust did
18:38licoressea f-key toggles the mode
18:38somniumnice
18:38licoresses/a/an
18:38licoresseyes, nice
18:39licoresseanyone with clozure experience?
18:39licoresseI was thinking about testing it for real mac os apps
19:24technomancylicoresse: you can use M-w to kill parens even if paredit is enabled
19:24technomancyit's like a way to break out of paredit's rules
19:25licoressetechnomancy: then I need to investigate why it won't here. Probably something that needs an update somewhere :-/
19:27hiredmanhuh
19:27hiredmanyoutube is pure python, go figure
19:35tomojeven the video processing?
19:36hiredmandunno, the google guy giving the unladen swallow presentation at the llvm conf said "pure ruby"
19:37hiredmaner
19:37hiredmanpardon
19:37hiredmanpure python
20:53gilbertleunghi
20:54gilbertleungsuppose 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:55gilbertleungthat is... limit the helper function to this one file only
20:59licoressedefn- perhaps?
20:59licoressegilbertleung: ...
21:00gilbertleunglicoresse: nice, thanks
23:47jlillyhow do you update the value of a variable?
23:47hiredmanyou don't
23:48durka42unless it's a reference type
23:48hiredmandurka42: shhh
23:48hiredmantell people that and they will use atoms everywhere
23:48hiredmanbest just tell them it's not possible
23:50jlillyheh.
23:50jlillyright. so I'm making a guess by number game.
23:51jlillyI need to update the guess so I can check to see if its right.
23:51hiredmanuser iterate
23:51hiredmanuse
23:52durka42or loop/recur
23:53hiredman(fn [x] (if (= x guessed_number) :win (get_guess)))
23:54hiredman(take-while (partial not= :win) (itreate that-fn (get-guess)))
23:56durka42,(doc iterate)
23:56clojurebot"([f x]); Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects"
23:57hiredmanhmmm
23:57hiredman~def iterate
23:58hiredmanthat is unfortunate