#clojure logs

2009-03-11

00:01RaynesI have a headache.
00:01RaynesI need to read
00:01RaynesIt's hard to read with a headache.
00:01Raynes:(
00:09hiredman?
00:12cooldude127ok i have the nailgun server running, no idea how to get a repl
00:16RaynesCan someone explain to me how this http://paste.lisp.org/display/76793#1 would ever get to the recur? Now, I'm not all that smart and all but I can't see how it would ever get past the recursion before the recur.
00:16RaynesI'm not all to well on Clojure evaluation apparently, or I'm just missing something because of this horrible headache.
00:18hiredmanthings in the do happen one after the other
00:18cooldude127Raynes: it looks like it should. after the first statement of the do occurs
00:18RaynesBut from what I can see, wouldn't the evaluation start at the top once the do hit's the first recursion.
00:19cmvkkthe first statement of the do will recur, but eventually that recurring will end, and when the stack unwinds back to that point the rest of the do will happen.
00:19Rayness/./?/
00:19hiredmanRaynes: but that recursion returns
00:19RaynesOh that's neat.
00:19RaynesThat's pretty damn cool.
00:19RaynesYou guys explain things so well. <3
00:20cooldude127hiredman: i have a repl, but i get an error when i try to send a toplevel to it
00:20cooldude127says couldn't execute nail
00:21hiredmanng needs to be in your path
00:21cooldude127hiredman: it is
00:22cooldude127hiredman: oh wait, i think i found the problem
00:22cooldude127incompatible versions of nailgun. i thought i had to download it before i realized vimclojure bundles it, and my ng wasn't compatible with vimclojure
00:23cooldude127so does the preview window open everytime i evaluate something
00:25Raynescooldude127: Old nailguns have a tendency to backfire and shoot nails into your eyes.
00:25RaynesAlways keep it uptodate.
00:26cooldude127lol
00:26replacawhat's nailgun? (besides the fun weapon from Quake)
00:27ayrnieuit's a construction device based on the Quake weapon.
00:28sohaillol
00:28hiredmanI personally prefer a palm nailer
00:28replacaI don't think that's what folks are talking about! o-o
00:50duncanmi think it's so funny that there are all these people learning a lisp, yet they go and use vi(m) instead of emacs
00:52Raynesduncanm: EMACS IS TEH BLOAT1!1
00:52duncanmwhatever
00:53duncanmyou have like 2GB of RAM on your computer
00:53Raynesduncanm: It was a joke bro.
00:53p_lRaynes: if a person who says this to me runs Firefox as his main browser, he would have his organs slowly and painfully rearranged in artistic way
00:53duncanmRaynes: yeah, but it's such a common refrain
00:53Carkand a 3Ghz computer, still emacs is dog slow =/
00:53RaynesAnd I do have 2 GB on my computer...
00:53RaynesWhat's wrong with that...
00:53p_lCark: byte compile ?
00:53duncanmRaynes: start menu/gnome-panel/osx's dock probably all use *more* memory than emacs by now
00:54p_lRaynes: cause Firefox is the king of bloat. My personal record was ~1.6G
00:54Carkp_l : actually i'm using emacs all the way, but it _is_ slow
00:54duncanmCark: what is it slow at doing?
00:54duncanmand how many extensions do you use?
00:54Carkduncanm : writing a single very long line
00:54p_lCark: can you break it?
00:54duncanmwriting to where?
00:55duncanmin the terminal, in X?
00:55RaynesI have netbeans with Enclojure, FireFox with 10 tabs, foxit reader with Programming Clojure, Thunderbird, Emacs with GHCi running in it and 3 Haskell buffers open, Digsby and the rest of the shit windows has open all under 1 gig on my 2 gb computer...
00:55hiredmanpfft, only ten?
00:55Carkin a console buffer
00:55Rayneshiredman: It's a slow night.
00:55RaynesCark: GUI Emacs.
00:55Carkyes
00:55Carki'm on windows ...
00:56duncanmthere's a console version of emacs for windows?
00:56cooldude127does vim have anything like emacs' paredit, where it always keeps parentheses matched
00:56Raynesduncanm: I believe so.
00:56Carkduncanm : there is one, i never used it though
00:56RaynesSomewhere...
00:56p_lRaynes: how long has your Firefox been running? certainly not two weeks :)
00:56Raynesp_l: 3 weeks.
00:56duncanmCark: oh, if it's slow inside a buffer running cmd.exe, the problem might be somewhere else
00:56Raynesnetbeans has been open for a whooping 12 days.
00:57p_lRaynes: wow.
00:57Carknah that's an emacs problem ... anyways, i try to avoid it, but get bitten sometimes
00:57RaynesI'm surprised it's still running after 12 days.
00:57duncanmhmm
00:57Carklike cooldude i would like to give vim a chance
00:57duncanmi don't really care for editor-wars, but after using emacs, it's hard to switch, mostly because of the ease of doing C-x 2 and what not
00:57durka42cooldude127: autoclose.vim. gets annoying sometimes though. surround.vim has some of the structural editing keybindings but none of the automagic
00:58RaynesI gave Vim a chance, the editor is l33t but I prefer modes instead of scripts.
00:58Carkduncanm : i'm sold on emacs ... just whish it was a bit faster
00:59duncanmCark: i'm really surprised that it's slow for you
00:59RaynesHe's lying.
00:59Cark!
00:59RaynesCark: Just kidding bro <3
00:59Cark=)
01:00RaynesHey I need yer opinionz. Would this be better with an explicit loop .. recur or is it cool the way it is? http://paste.lisp.org/display/76793#1
01:00hiredmanhttp://groups.google.com/group/comp.lang.lisp/msg/81a24e488491e8ff <-- c.l.l posting on lisp+vim tips
01:00RaynesI like it the way it is. :-)
01:01duncanmRaynes: oh, well, you'll blow the stack if n is too big
01:02duncanmRaynes: if it were scheme, you'd be fine
01:02RaynesBut a loop recur would be ugly :\
01:02RaynesI think...
01:02duncanmRaynes: well, that's why we want TCO in the JVM
01:02duncanmonce there's TCO in the JVM, loop/recur can go away
01:03Chouserbut thankfully it won't.
01:03RaynesHrm.
01:03duncanmChouser: you're against it?
01:04Chouserno, I'm in favor of TCO, but I'm also in favor of loop/recur
01:04duncanmChouser: well, of course - without TCO, loop/recur is the only way to go ;-P
01:05RaynesChouser: Could you hold me? Just a little O.O
01:05cooldude127loop recur is awesome
01:05duncanmhuh?
01:05duncanmcooldude127: named LETs are even nicer
01:05cooldude127great for when the loop arguments don't match the function arguments
01:05cooldude127duncanm: i don't always feel like naming my helpers
01:05duncanmcooldude127: name it loop then
01:06cooldude127at that point, why not just have the loop form?
01:06cooldude127it makes it clear what the point is
01:06ChouserEven after TCO, I'll use 'recur' whenever I can.
01:06duncanmcooldude127: do you know about tail call optimization?
01:06cooldude127yes
01:06duncanmChouser: recur is a special macro that looks back?
01:07ChouserIf I believe I'm in the tail position and use 'recur', the compiler will flag me if I'm wrong.
01:07Chouser'recur' is a special form.
01:07cooldude127TCO is great, but i don't really mind loop/recur
01:07cooldude127and i love having it when the signatures don't match
01:07cooldude127it's very succint
01:07duncanmwhat happens when the loops are nested?
01:07cooldude127duncanm: actually, that has yet to come up for me
01:07Chouserrecur is simple and explicit. It lets the reader know that I'm certain there won't be any stack overflow here.
01:08hiredmanrecur recurs to the closest frame
01:08duncanmone of the scary things one could do with named lets is that it allows you go jump to whichever label you want to
01:08cooldude127well, i need sleep
01:09hiredmanduncanm: that is mutual recursion, so you can use letfn or trampoline
01:09ChouserThere are cases where recur is insufficient, so you still want TCO.
01:09ayrnieu(let 10 ... (let 20 ... (let 30 ... (goto 20) ...
01:09duncanmhiredman: loop/recur is basically a trampoline, isn't it?
01:09ayrnieu(this may require nonstandard indentation)
01:10hiredmanduncanm: I dunno how it is represented in byte code
01:10duncanmayrnieu: if you're writing Scheme, you can replace (goto 20) with (20 ...)
01:10Carkduncanm : more like a rebinding goto i think
01:10Chouserloop/recur is basically a while loop
01:10Chouseror yes, a goto
01:10Chousercompiles down to very efficient java bytecode
01:11duncanmhttp://lambda-the-ultimate.org/node/3106
01:11hiredmantrampoline on the other hand is a very simple function, who's source I just looked at today
01:11hiredmanduncanm: trampoline and loop/recur are different mechanisms
01:11ayrnieuduncanm - tsk, I have higher standards of readability than that!
01:12duncanmhiredman: but the idea of a trampoline is just a loop (for, while)
01:12duncanmisn't it?
01:12hiredman~def trampoline
01:13hiredman,(doc trampoline)
01:13clojurebot"([f] [f & args]); trampoline can be used to convert algorithms requiring mutual recursion without stack consumption. Calls f with supplied args, if any. If f returns a fn, calls that fn with no arguments, and continues to repeat, until the return value is not a fn, then returns that non-fn value. Note that if you want to return a fn as a final value, you must wrap it in some data structure and unpack it after trampoline
01:13duncanmhiredman: i wasn't referring to the clojure-specific definition
01:13ayrnieuhiredman, duncanm is talking about trampolines, not about the clojure function named 'trampoline'.
01:13duncanm *
01:13duncanm * Used in some LISP implementations, a trampoline is a loop that iteratively invokes thunk-returning functions.
01:14ChouserClojure's loop/recur does not use thunks or closures of any kind.
01:14duncanmok ok
01:15Chouserbut it does avoid consuming stack frames, which trampolines also do.
01:42slashus21Having (re-seq #"\w+" message) really screws up the code highlighting in enclojure
01:43slashus21when you reload a dispatch function to a multimethod do you have to reload the (defmulti method too?
01:43slashus21It seems to be the behavior
01:49RaynesAnyone feel like converting this to use loop recur instead of recursion? http://paste.lisp.org/display/76793#1 I can't think with this headache. :|
02:03catch23anyone know the proper way for doing object serialization on clojure objects? (sequences, maps etc)
02:05catch23using normal java-style object serialization doesn't seem to work out of the box... or at least it failed on my persistentarraymap of just strings
02:05maaclCan anyone help me with getting a emacs/slime setup for working with compojure up and running - slime works with clojure and i can run the compojure app from the commandline via a launch script, but I cannot compile inside emacs - get missing source file. installed clojure using cljoure-install
02:06Carkcatch32 : try printing with *print-readbly* bound to true
02:06Carkcatch32 : then just read the string
02:06hiredman,(doc prn)
02:06clojurebot"([& more]); Same as pr followed by (newline). Observes *flush-on-newline*"
02:06hiredmanugh
02:07hiredman,(doc pr)
02:07clojurebot"([] [x] [x & more]); Prints the object(s) to the output stream that is the current value of *out*. Prints the object(s), separated by spaces if there is more than one. By default, pr and prn print in a way that objects can be read by the reader"
02:07Cark,(pr (sorted-map :a 1))
02:07clojurebot{:a 1}
02:07Carkno good
02:08Carkyou might want *print-dup* true i guess
02:08Cark,(doc *print-dup*)
02:08clojurebot"; When set to logical true, objects will be printed in a way that preserves their type when read in later. Defaults to false."
02:08hiredmanit depends
02:08hiredmanI just use prn, because I don't really care what kind of hash I get back
02:09catch23so prn is good? I've been using prn for just debugging print tasks... I guess I don't care too much about the types either
02:10hiredmanprn will try to print an object in a away that can be read by read
02:10Carkjust keep in mind it won't work for java objects
02:10Carkand functions
02:12catch23kk
02:13hiredmanclojurebot: spin?
02:13clojurebotTitim gan �ir� ort.
02:13hiredmanclojurebot: roulette
02:13clojurebotclick
02:13hiredmanclojurebot: roulette
02:13clojurebotclick
02:13hiredmanclojurebot: roulette
02:13clojurebotclick
02:13hiredmanclojurebot: roulette
02:13clojurebotclick
02:13hiredmanthe suspense is killing me
02:13hiredmanclojurebot: roulette
02:13clojurebotclick
02:13hiredmanclojurebot: roulette
02:13clojurebotclick
02:13hiredmanclojurebot: roulette
02:13clojurebotbang
02:13hiredman!
02:14cmvkkoh god
02:14cmvkknow all you need is a trivia module.
02:14cmvkkand maybe a random dice throw.
02:14hiredman1d4+3
02:14clojurebot6
02:16catch23Cark: you think prn is the same as doing .toString() on the object?
02:16hiredmanit is not
02:16hiredmanwell
02:16hiredmanactually
02:17hiredman,(.toString {:a 1})
02:17clojurebot"{:a 1}"
02:17Raynes,(filter #(if (= (rem % 3) 0) true false) (range 1 1000))
02:17clojurebot(3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 93 96 99 102 105 108 111 114 117 120 123 126 129 132 135 138 141 144 147 150 153 156 159 162 165 168 171 174 177 180 183 186 189 192 195 198 201 204 207 210 213 216 219 222 225 228 231 234 237 240 243 246 249 252 255 258 261 264 267 270 273 276 279 282 285 288 291 294 297 300 303 306 309 312 315 318 321 324 327 330 333 336 339 342 345
02:17hiredmanI would not count on it being
02:17hiredmanRaynes: you don't need the if
02:17RaynesI just realized that.
02:17RaynesIt's a predicate -.-
02:18Carkcatch32 : why would you use .toString ?
02:18RaynesMy headache is easing, I should just go to bed, but I thought I'd solve Euler problem 1 before sleepytiem.
02:18hiredmanRaynes: do it with for
02:18hiredman~for
02:18clojurebotfor is not used often enough
02:19slashus21list comprehension is awesome
02:19RaynesBut why ._.
02:19hiredmanbecause for is way cool
02:19Rayneshiredman: is your single objective in life to make me stay up longer? :|
02:20hiredman,(for [x (range 100) :when (= (rem x 3) 0)] x)
02:20clojurebot(0 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 93 96 99)
02:21RaynesWell now that you went ahead and ruined for me...
02:23Raynes(for [x (range 1 1000) :when (= (rem x 3) 0)] x) eureka.
02:23RaynesAnd I did it without looking at hiredmans :D
02:24RaynesMe go sleepy now.
02:24cmvkki like that problem...it reminds me of FizzBuzz.
02:24cmvkkis there a clojure fizzbuzz solution repository somewhere? i hope so.
09:07gnuvinceHi
09:07gnuvinceIn EDT time, what time does Rich's QCon talk start?
09:08gnuvinceIt says 14:15 on the website, so that'd be 9:15 here?
09:08marklargnuvince: its in london?
09:08gnuvinceyeah
09:09marklarsounds right then :)
09:09gnuvinceI was wondering if they have daylight saving time too
09:09marklarwell, its 1pm there now
09:10marklarso I guess 1015 EST
09:10marklaris it being broadcast?
09:35danlarkindon't see links for streaming
09:45cemerickhas anyone tried driving a browser DOM with clojure within an applet?
09:48Chousercemerick: almost: http://clojurescript.n01se.net/
09:48Chouserthat includes an applet that provides functionality to some javascript which in turn drives the DOM
09:48cemerickChouser: Too bad you can't distill all of our regular Java codebase down to javascript, too!
09:48cemerickah, I didn't realize that
09:49cemerickChouser: hrm, the applet fails to load for me. OS X, FF3
09:49Chouserthat javascript was produced from clojurescript sources, but that's probably beside the point of your question.
09:49Chouseryeah, none of my clojure applets work on Mac
09:49ChouserI haven't tracked down why yet.
09:49cemerickthat's interesting
09:52cemerickoh, isn't the applet tag semi-deprecated? I thought object was the way to go these days...
09:54cemerickwe need to make a GUI decision in the next couple of weeks, and I'm looking at titanium as a possibility. Titanium + a "back end" applet + DOM scriptability from that applet might be a nifty combination.
09:55HolcxjoSo, has anybody found links for streaming of the talk? Would surpise me. They charge you ��� (that's $$ with the current exchange rate) to see the talks in person....
09:56HolcxjoI opted for the free option and will hear his talk at SkillsMatter to the London Java nerds...
09:56StartsWithKcemerick: jnlp from webstart is a way to go for applets
09:57StartsWithKalso, while i didn't test this with clojure, proguad is something to try
09:57cemerickStartsWithK: the point is, we wouldn't be using swing for the UI -- that'd be entirely browser DOM
09:57StartsWithKit could minimize your applets to only copule of kb
09:57cemericktitanium is webkit wrapped up so that you can deploy a "rich browser-based application" as a self-contained thick client
10:00StartsWithKjnlp will let you control heap size and will jvm run in separate process (with jre6u10+), its more than just webstart configuration, also applet can be cached on client side it ftat is what you need
10:00StartsWithKjust a suggestion
10:01cemerickStartsWithK: Sure, thanks. I've used webstart before. However, distribution isn't an issue -- this is going to be thick client that is downloaded and installed, anyway. I'm just looking at alternatives to swing.
10:02StartsWithKmaybe some other gui toolkit fo java
10:05maaclCould someone help getting compojure to compile from within emacs? I have the compojure jar in my classpath and I can run the compojure examples from the commandline using a script
10:07AWizzArdmaacl: why don't you want to use ant for compiling compojure?
10:07AWizzArdwould it not be easier to simply cd into the compojure dir ant type "ant"?
10:07maaclAWizzArd: sorry expressing myself badly, want to compile the compojure example
10:07maaclAWizzArd: sorry
10:08AWizzArdwhat is your *compile-path*?
10:09AWizzArd,*compile-path*
10:09clojurebotnil
10:09AWizzArd(binding [*compile-path* "/this/is/in/my/classpath/"] (compile 'my.module))
10:09maacl"classes"
10:10AWizzArdAnd do you have a directory named classes on your system?
10:10maaclnot at all
10:10AWizzArdI think it should at least be "/classes"
10:10AWizzArdtell me one directory that you have in your classpath pls
10:11maacl"/Users/mac/src/clojure/clojure.jar"
10:11AWizzArdIn emacs do: (System/getProperty "java.class.path")
10:11StartsWithKcemerick: https://pivot.dev.java.net/ never can remeber the name..
10:11StartsWithKlooks nice, has that web 2.0 look
10:12AWizzArdmaacl: as you note, the clojure.jar is a .jar file and not a directory. What we need now is a directory that is in your classpath.
10:12StartsWithKbut it is underdocumanted and experimental(?)
10:12maaclAWizzArd: I get "/Users/mac/src/clojure/clojure.jar:/Users/mac/Development/lib/compojure/compojure.jar"
10:12AWizzArdokay, that means there are only two .jar files in your classpath, but not a directory.
10:12maaclright
10:13AWizzArdMake a dir in Vista, such as: /Users/mac/clj_build/
10:13AWizzArdC:\Users\mac\clj_build
10:13AWizzArdgnuvince: oh, you wished me good luck too, I felt it. Thanks :)
10:14maaclAWizzArd: ok
10:14gnuvinceAWizzArd: are you giving a talk?
10:14AWizzArdgnuvince: no, but it seems you need more training in telepathy. You did not address exclusively Rich with it. Felt more like a global "good luck" thing.
10:15gnuvinceDamn
10:15AWizzArdmaacl: so, if you now created this directory, add it to your classpath. If you are using Emacs+Slime you would want to edit your .emacs file and add this new path to swank-clojure-extra-classpaths.
10:16AWizzArd;-)
10:17AWizzArdmaacl: when you added this and restarted emacs+slime+clojure and do (System/getProperty "java.class.path") again, then you will see /Users/mac/clj_build/ as well showing up.
10:17AWizzArd,(System/getProperty "java.class.path")
10:17clojurebotjava.security.AccessControlException: access denied (java.util.PropertyPermission java.class.path read)
10:19cemerickStartsWithK: looks interesting. The "kitchen sink" demo fails to impress, unfortunately.
10:19maaclAWizzArd: I added "(swank-clojure-config (setq swank-clojure-extra-classpaths (list "~/src/jars")))" to .emacs but I still get the same result
10:24AWizzArdmaacl: then this did not help. Delete this entry from your .emacs again. Instead look at http://paste.lisp.org/display/71211
10:24AWizzArdin your .emacs you can find (custom-set-variables
10:25AWizzArdand then there are several things listed in there. Add '(swank-clojure-extra-classpaths "/path/clojure.jar" "/path/compojure.jar" "/Users/mac/clj_build/")
10:29maaclAWizzArd: ok
10:33maaclAWizzArd: still the same
10:38gnuvinceIf twitter is any indication, Rich's talk seems to be going well
10:38gnuvince" samaaron: Watching Ritch Hickey talk about Clojure at #QCon - very exciting stuff indeed :-) "
10:42StartsWithKwill we get a video online?
10:51maaclAWizzArd: think I found the culprit : an old .emacs.elc file
10:55AWizzArdgnuvince: any comments about his hairstyle yet? ;)
10:57maaclAWizzArd: now I got the classpath working, but I still get the no sourcefile error
11:00AWizzArdmaacl: did you use the binding?
11:01maaclAWizzArd: sorry, which binding?
11:01maaclAWizzArd: I use C-x C-e on the first expression
11:02StartsWithKlisppaste8: help
11:02lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
11:03lisppaste8StartsWithK pasted "Swing menu builder" at http://paste.lisp.org/display/76826
11:04cgrandAWizzArd: no comment on the hairstyle yet. Ola Bini "Most of Rich Hickey's Clojure presentation finished at #qcon. As expected, it is excellent."
11:04StartsWithKshortcut for mnemonic and accelerator work for any javax.swing.AbstractButton, not just menu items
11:07pjstadigrich changed his hairstyle?
11:07Chousercgrand: are you working on finger trees for clojure?
11:08gnuvinceAWizzArd: whose?
11:09cgrandChouser: nothing serious, just playing/learning at the moment. Why?
11:09gnuvincehttp://twitter.com/danny_l/status/1310947068
11:10Chouserjust curious. since rich mentioned them I've been meaning to read up, but haven't yet.
11:12cgrandI skimmed over the paper when rich mentioned them and gave up but the two articles I linked to in my yestertweet made take another look
11:15pjstadigi think i studied finger trees
11:15pjstadigi forget
11:15pjstadigthe thing i *do* remember from my graph algorithms class is splay trees
11:19AWizzArdmaacl: binding *compile-path* to the path in which you want Clojure to put the resulting .class files.
11:25maaclAWizzArd: I get "java.lang.NoClassDefFoundError (index.clj:1)"
11:26lisppaste8maacl pasted "index.clj" at http://paste.lisp.org/display/76828
11:27maaclAWizzArd: just pasted what I am trying to compile
11:32brianhcgrand: would you mind pasting those two links?
11:34cgrandbrianh: http://blog.sigfpe.com/2009/01/fast-incremental-regular-expression.html and http://apfelmus.nfshost.com/monoid-fingertree.html
11:34brianhcgrand: thx!
11:39maaclAWizzArd: using the binding gives me: "java.lang.NoClassDefFoundError (index.clj:1)"
11:40durka42what is a monoid vs a monad?
11:44Chousukethe first comment on that regexp article: "In other words, deterministic finite state automata and thus regular expressions are actually monoid morphisms from the free monoid over the alphabet to a finite monoid, namely the monoid of endomorphisms on the states."
11:44ChousukeI'd say you're doing just fine if you can understand that.
11:45cgranddurka42: informally speaking a monoid is a function f of two args such that (= (f a (f b c)) (f (f a b) c))
11:46durka42okay
11:47Chousukehmm
11:51danlarkinassociativity!
11:55maaclAWizzArd: (all-ns) shows the compojure namespace - I really don't get this
11:56cgrandand it means that if f is associative then (reduce f init coll) does not depend on the order of the elements in (seq coll), this allows you to parallelize reduction or to incrementally compute a reduction (it reminds me of a blog post I read about CouchDb indexes)
11:59HolcxjoWell, the order of elements in the seq stil matters -- the order of evaluation doesn't, right? Being associative does not imply being commutative.
12:00cgrandHolcxjo: you're right
12:02cgrandand CouchDb requires reduce functions to be associative and commutative http://damienkatz.net/2008/02/incremental_map.html
12:16maaclAWizzArd: any further hints? otherwise thanks for the effort, really appreciated
12:28stimulihowdy
12:28stimuliis there a predicate to determine is a value can respond to seq ?
12:29stimuliso, it would return true for all collections, and false otherwise
12:29AWizzArdmaacl: I suggest you try a minimal example. Make a new .clj file containing only something like (ns com.domain.Application (:gen-class)) and maybe a function (defn foo [] 'works)
12:29danlarkin(doc coll?)
12:29clojurebotReturns true if x implements IPersistentCollection; arglists ([x])
12:29AWizzArdtry to compile that. If you do so then com.domain.Application needs to be in your classpath as well, so add it to the swank-clojure-extra-classpaths list.
12:30stimulidanl : thanks
12:33gnuvinceI'm getting a java.lang.VerifyError exception at line 0 in a Clojure file. What is that about?
12:36leafwgnuvince: recompile
12:37gnuvinceah
12:37gnuvincefixed it
12:38maaclAWizzArd: will give that a try
12:39catch23there's 3 methods in a class with the same name, overloaded by a single argument, how can I make the call specifying the type?
12:40maaclAWizzArd: just to be clear if my file is called simple.clj and is located in /Users/mac/Development/clojure/ what should the binding look like?
12:40catch23specifically, it's executorservice.submit, i'm guessing the fn can be cast to runnabletasks or callable, how can I cast my fn to a callable?
12:40cemerickcatch23: (.someMethod obj #^Callable some-callable) should do it
12:41catch23cemerick: ah ok thanks
12:43AWizzArdmaacl: it depends on how you call your namespace. If you have (ns com.domain.simple (:gen-class)) and your file is called simple.clj, then it should be located somewhere in your classpath. For example let's say you have C:\foo in your classpath. Then you need to make the dir C:\foo\com\domain\ and into that dir put the simple.clj.
12:44AWizzArdmaacl: then you can do (binding [*compile-path* "/foo/"] (compile 'com.domain.simple)). The resulting .class files can then be found in C:\foo\com\domain\.
13:35maaclAWizzArd: the simple.clj example works - I get simple$foo__1625.class simple.class and simple__init files in the correct directory
13:42gnuvinceWas anyone at Rich's talk today?
13:43Chouseryeah, several people apparently.
13:43Chouserbut I don't know if any of them are here. ;-)
13:48WizardofWestmarcDid Rich say if it was going to be recorded and posted online or not?
13:48ChouserI've not heard anyone mention that they're sure of either.
13:50danlarkinI'm quite sure it'll be online
13:51danlarkindon't know the schedule though
13:52Chouseroh, great.
13:55WizardofWestmarcif it takes a while that's fine, I just want it sooner or later :)
13:55WizardofWestmarcseems like every time I see one of Rich's talks I pick up something new
13:56RaynesIs there a function like map that applies a function to 2 elements from a sequence instead of just one at a time?
13:57WizardofWestmarcmap
13:57WizardofWestmarcjust give it two lists
13:57WizardofWestmarc(map func (a b c) (d e f))
13:58WizardofWestmarcwill call (func a d) (func b e) (func c f)
14:04Chouser,(map + [1 2 3] [4 5 6])
14:04clojurebot(5 7 9)
14:05Chouser,(map (fn [[a b] (+ a b)]) (partition 2 [1 2 3 4 5 6]))
14:05clojurebotjava.lang.RuntimeException: java.lang.RuntimeException: java.lang.Exception: Unsupported binding form: (+ a b)
14:05Chouser,(map (fn [[a b]] (+ a b)) (partition 2 [1 2 3 4 5 6]))
14:05clojurebot(3 7 11)
14:06WizardofWestmarcah ha, was trying to think of what function did that
14:06WizardofWestmarcit's partition
14:06WizardofWestmarc,(partition 3 [1 2 3 4 5 6])
14:06clojurebot((1 2 3) (4 5 6))
14:08AWizzArdmaacl: good, then you have now seen the basics of how it works. You can go step by step and make your program more complex. Make it more and more into this compojure example that you found somewhere.
14:18maaclAWizzArd: yeah, it breaks the moment i introduce :use compojure
14:20spaceman_stuspeaking of compojure, I'm getting a ClassNotFoundException: javax.servlet.http.Cookie error when I'm trying to run the example code. I'm guessing I'm doing something dense - any tips?
14:23danlarkinspaceman_stu: do you have the servlet-utils jar?
14:24spaceman_stuI'm betting it's a classpath thing. Thanks
14:24leafwanybody using vimclojure 2? Where should the local.properties go to? In the working dir, or the ~/.vim/ dir ?
14:31durka42leafw: ant needs local.properties when building vimclojure
14:31durka42put it in the same dir as build.xml
14:32leafwdurka42: thanks
14:32leafwwhat I don't understand is why there isn't .jar included.
14:32leafwnever mind
14:45Lau_of_DKGood evening gents
14:45WizardofWestmarcheya Lau, how goes?
14:46Lau_of_DKTimes are interesting, my tasks at work that all require ~100% concentration :) You?
14:53WizardofWestmarcwork day going by slowly
14:53WizardofWestmarcwant to go home and hack on clojure
14:54maaclis the clojure.jar in compojure/deps broken ?
14:54Lau_of_DKWizardofWestmarc: Sounds familiar... from my old job :)
14:55Lau_of_DKmaacl: No, but its probably very old
14:55danlarkinWizardofWestmarc: aye I'm with you on that
14:55maaclLau_of_DK: ok, I get an error when I try to use it with swank
14:56leafwvimclojure 2.0 isbroken .. or not very well tested. It's a pitty really
14:56leafwI'd love to use it
14:58WizardofWestmarchow useable is compojure currently anyway?
14:58WizardofWestmarcI've been working on something in django but it's early enough would still be easy to change
14:58hiredmanclojurebot: latest?
14:58clojurebotlatest is [1327 "fixed seque"]
14:58hiredmanclojurebot: latest is 1327
14:58clojurebotc'est bon!
14:59Lau_of_DKWizardofWestmarc: Check out Madison Square Clabango then, Django port
14:59Lau_of_DKBut on the other hand, Compojure is not letting me down
15:00maaclLau_of_DK: I get java.lang.ExceptionInInitializerError (NO_SOURCE_FILE:0) ? any ideas
15:03durka42leafw: are you referring to vimclojure after the merge with gorilla?
15:03leafwes
15:03leafwyes
15:03durka42it's... a bit rocky
15:03durka42under heavy development, shall we say
15:03leafwand the docs need chcking
15:03durka42(not by me)
15:04leafwfor example, is it let g:clj_wants_gorilla = 1 or let clj_wants_gorilla = 1 (without the g) ?
15:04leafwdifferent parts of the docs say different things
15:04durka42let g:clj_want_gorilla = 1
15:04durka42says my vimrc
15:05leafwmakes sense, considering the previous let g:* commands
15:05danlarkinLau_of_DK: you've got me saying clabango in my head, curse you!
15:08leafwdurka42: also \p doesn't work, to close the scratch buffer
15:08leafw*sigh*
15:09durka42bah, works for me :\
15:09durka42i'm not any kind of vim expert
15:09hiredmanI have no idea what this localleader thing is or how it works
15:09leafwI am reasonably savvy with vim
15:09Lau_of_DKmaacl: That can be anything, try checking where the files in the project are being initialized
15:09Lau_of_DKdanlarkin: I appologize - But I guess now you know how I feel :)
15:09leafwthe local leader is \ by default.
15:09durka42well i assume leafw's localleader works if he got the preview window open
15:09Lau_of_DKHave you upped Madison Square Clabango on Github yet?
15:09leafw\ef works, but \p doesn't.
15:10hiredmanleafw: so? what does it do?
15:10durka42\p issued from the same window that \ef was
15:10leafwhiredman: \p should close the scratch buffer that any code evaluation opens.
15:10leafwdurka42: I see. So its the other window which gets the focus though
15:11leafwalso the editor locks up until the eval operation completes.
15:11hiredmanerm, like :\p ?
15:11durka42well, when i do \ef the preview window opens but focus stays in the window with the file
15:11durka42hiredman: no, \ef in normal mode
15:11leafwdurka42: now it did it -- not the first ime
15:12durka42i think the \ef semantics could use some tweaking anyway -- for me, after i do \ef i want the preview window closed soon (unless there are error messages in it) and the focus to the REPL so i can test things
15:13danlarkinLau_of_DK: haven't had time to work on it in a handful of days, so no :-/
15:14leafwoh wow the repl now works.
15:14leafw\sr, I had forgotten -- it never worked before
15:14teLau_of_DK: Have you heard anything more about Madison Square Clabango>
15:14teI'd really like to play with it
15:14durka42the repl is the best part :)
15:15durka42by the way, careful -- i don't think the repl has a timeout yet
15:16Lau_of_DKte, danlarking who you see chatting in the channel right now, is the creator of Madison Square Clabango
15:16leafwthe repl deletes a line with control+w+w, instead of switching windows ...
15:16durka42C-ww in normal mode
15:16Lau_of_DKAs I understand he's been a little lazy, but will recompense ASAP - so we can expect to see something on Github... when dan ? :)
15:17tedanlarkin: Hola :)
15:17leafwdurka42: I need some mental reworking, not used to a repl being an actual insert mode.
15:17tedanlarkin: What's the word on Madison Square Clabango?
15:19Lau_of_DKdanlarkin: We demand code! Upload Madison Square Clabango! :)
15:19pjstadigdanlarkin: upload!
15:19danlarkinhaha oh jeez
15:19telol im sorry man
15:19tei just heard about your project and am anxious
15:19tei understand if you're not ready to release anything
15:19Lau_of_DKI dont
15:19pjstadigme either
15:19danlarkinwell I just want to have reasonable test coverage before I upload
15:19Lau_of_DKIts a cool project, and you should get it up so we can contribute cool stuff and take over the web
15:19telol well i really don't either
15:19tebut for the sake of being cordial
15:20durka42tough crowd today
15:20tei dont get no respect
15:20pjstadigyeah we want to take over the web with futuristic ninja robots
15:20te^
15:20Lau_of_DKyea "Rails was walking along one day, when suddenly, CLABANGO! hit him"
15:20tedanlarkin: could i say one thing?
15:20Lau_of_DKSounds awesome
15:21tedanlarkin: madison square clabango is by far, the greatest name for a project -- EVER
15:21pjstadigagreed
15:21danlarkinte: no. way.
15:21teyes dude. yes.
15:21teim serious. it's so damn memorable i can't quit thinking about "clabango".
15:21terails = boring. clabango = awesome.
15:21Lau_of_DKTruer words are rarely spoken
15:21pjstadigclojure on clabango
15:22danlarkinmadison!
15:22Lau_of_DKSquare!
15:22teim from madison
15:22pjstadigCLABANGO!
15:22hiredmanYawfie
15:22tei like squares
15:22pjstadigit's totally an action word
15:23pjstadigZIP!
15:23pjstadigPOW!
15:23tewtf is clabango anyway?
15:23pjstadigCLABANGO!
15:23teis it just a made up word?
15:23slashus2clojure django?
15:23teive googled clabango and all i could come up with is a log of this very irc channel talking about it
15:23tegoogle whack
15:23slashus2It seems that I remember uddering that one day.
15:24teuddering is awesome
15:25Lau_of_DKClabango is going to be the next big thing....
15:25noidihow can i do string interpolation in clojure?
15:25teyeah im fucking psyched
15:25noidisomething like sprintf or python's % operator
15:26teim going to be making clabango shirts, hats, etc.
15:26durka42(doc format)
15:26clojurebotFormats a string using java.lang.String.format, see java.util.Formatter for format string syntax; arglists ([fmt & args])
15:26noidithanks
15:26Lau_of_DK,(format "hi subject # %d" 5)
15:26clojurebot"hi subject # 5"
15:26teclabango should be some kind of weird mascot
15:27telike an anteater with hi-tops for feet
15:27tenot like -- wearing hi-tops, but literally, hi-tops for feet
15:27durka42i'm thinking one of those clapping monkeys
15:27teyeah that's too obvious though
15:27teyou need a weird twist on it
15:27tea clapping monkey with Ronald Reagen's face
15:27danlarkinI think I'm sticking with Madison... you guys are free to use clabango as your mascot
15:28tedanlarkin: is it Madison Square clabango, or Madison^2 Clabango
15:28slashus2clojure on acid
15:28teClojure for Hardcore Drug Addicts
15:28Lau_of_DKdanlarkin: You dont have to tell me twice
15:29Lau_of_DKhttp://github.com/Lau-of-DK/clabango/tree/master
15:29Chouseryou'd own the google search space for clabango. Not true of madison.
15:29danlarkinhahah
15:29rsynnottte: spitting image ronald reagan, or real ronald reagan
15:29rsynnott?
15:29Lau_of_DKte, originally I suggested Clabango to Dan, he didnt like it, so he went with 'Madison', so I dubbed the project Madison Square Clabango. But since its up for grabs, I got it :)
15:30tersynnott: real ronald reagan
15:30tersynnott: as a clapping cymbal monkey
15:30rsynnotthopefully from at least a few years ago; it is unlikely that he has much face to speak of at this point
15:30RaynesI just discovered trampoline :>
15:31slashus2bounce bounce bounce
15:31pjstadigseriously. clabango.
15:32rsynnottwhat is clabango, anyway?
15:32durka42pjstadig: how's the terracotta going so we can use a huge server cluster to host the clabango sites that will take over the web?
15:32pjstadighehe
15:33Lau_of_DKyea, thats the big question
15:33telet me tell you what clabango is:
15:33teawesome.
15:33Lau_of_DKWhen is TerraBango ready for primetime?
15:33pjstadigi'm smoothing out the interactions with multiple REPLs
15:33danlarkinLau_of_DK: oh jeez, terrabango...
15:33teMr. Clabango
15:33pjstadigi'm getting a weird NPE in BitmapIndexedNode when I def in a REPL that was reconnected to the cluster
15:34pjstadigthe NPE goes away after doing a (ns-map 'user)
15:34pjstadigi think i'm not configuring TC correctly or something
15:34durka42so terracotta is like not loading everything right away?
15:35pjstadigwhat do you mean?
15:35durka42ns-map seems like it would be doing something akin to a dorun
15:35pjstadigright
15:35hiredman,(doc ns-map)
15:35clojurebot"([ns]); Returns a map of all the mappings for the namespace."
15:35pjstadigyeah TC works like a virtual memory
15:36pjstadigif it's not in your VM and you try to get it, then it gets brought to your VM
15:36durka42but def is assuming it's there when it isn't yet
15:36pjstadigbut according to the TC site you should only get an NPE for uninstrumented code
15:36pjstadigwhich shouldn't be the case
15:36durka42hrmm
15:37pjstadigi'm trying to learn TC and the internals of Clojure at the same time, so it's a challenge
15:37pjstadiginteresting tho
15:39pjstadigCLABANGOCOTTA!
15:39durka42i think TerraBango's better
15:39pjstadigoh
15:40pjstadigi might have fixed the NPE
15:40pjstadigyeah
15:41pjstadigthe problem appears to have been that BIN clones it's node array instead of creating a new one and doing an arraycopy
15:41durka42you say that now, until later... it comes back when you LEAST expect it... and then *vanishes* without a backtrace
15:42pjstadigi really want to move on to something more interesting like getting agents to work, but this stupid NPE his been blocking me for a few days now
15:42pjstadigman that sucked
15:43Lau_of_DKI know the feeling, you try to get some real work done, and suddenly, CLABANGO! you set back a week
15:44hiredmanclojurebot: suddenly is <reply>CLABANGO!
15:44clojurebot'Sea, mhuise.
15:45durka42clojurebot: i was walking in the park, when suddenly...
15:45clojurebotCLABANGO!
15:45pjstadighehe
15:45durka42gotta love that fuzzy matching
15:45teclojurebot: I was just frolicking around in a field of black eyed susans, when out of nowhere, suddenly...
15:45clojurebotCLABANGO!
15:47Lau_of_DKhaha
15:47Lau_of_DKniceness
15:48teclojurebot: So I'm proposing to my wife and I get down on one knee and I flash the ring, and pop the question-- She looks into my eyes and screams out suddenly...
15:48clojurebotone is B
15:49teclojurebot: forget one
15:49clojurebotI forgot one
15:49teclojurebot: So I'm proposing to my wife and I get down on one knee and I flash the ring, and pop the question-- She looks into my eyes and screams out suddenly...
15:49clojurebotring is http://github.com/mmcgrana/ring/tree/master
15:49tedamnit
15:49Chouserhehe
15:50hiredmanclojurebot: botsnack
15:50clojurebotthanks; that was delicious. (nom nom nom)
15:50Raynes,(reduce + (for [x (range 1000) :when (or (zero? (rem x first-num)) (zero? (rem x second-num)))] x)))
15:50clojurebotjava.lang.Exception: Unable to resolve symbol: first-num in this context
15:51RaynesOops :>
15:51RaynesThat's what you get for copypasting code straight from a function.
15:51Raynes,(reduce + (for [x (range 1000) :when (or (zero? (rem x 3)) (zero? (rem x 5)))] x)))
15:51clojurebot233168
15:51RaynesProject euler problem one: Complete.
15:51Lau_of_DKlol
15:52hiredmanit's too bad about that reduce on the outside
15:53Lau_of_DK,(reduce + (distinct (concat (range 3 1000 3) (range 5 1000 5))))
15:53clojurebotjava.lang.NoClassDefFoundError: clojure/core$distinct__4588$step__4590
15:53durka42erp?
15:53Lau_of_DKThats no good, its from the clojure-euler.wikispaces.com
15:53Rayneshiredman: I'm fixing that as we speak.
15:55hiredmanclojurebot may be broken
15:55RaynesWorks on my REPL
15:55RaynesI like my implementation better :>
15:55hiredmanyeah
15:56RaynesConsidering I have only been using Clojure for about 3 weeks, and haven't even finished the functional programming chapter of stu's book, I think I did pretty good...
15:56shooverthanks for the enthralling hype around Clabango, folks. In a day of tough bug fixing, that's quality entertainment!
15:57danlarkinhahh
15:58shooverdanlarkin: laughing is for closers. get back to work until the code is pushed
15:58danlarkin:( yessir
15:59lisppaste8slashus2 pasted "tail recursion?" at http://paste.lisp.org/display/76850
16:00slashus2I was working on this, and I am having a hard time seeing why the last function's recur isn't in the tail position (for the loop)
16:00slashus2next to the last function
16:01Raynesslashus2: The last function is inside the loop after the recur.
16:01slashus2Raynes: hum?
16:01RaynesAdd another parenthesis on the end of the recur line and remove one from the last line.
16:02slashus2I wanted the recur to be conditional so I can terminate.
16:02durka42because the function needs the result of the recur to feed into the if
16:02teI hear clabango implements hidden markovs to somehow guess at the code you're going to write
16:03durka42oh, wait, no
16:03RaynesThere is another function call after the recur.
16:03dnolenslashu2: the result, real-prime-factors, is not in the if statement
16:03danlarkinte: correct
16:04slashus2yey
16:04slashus2thank you
16:04slashus2that was it!
16:05slashus2pos-prime-fact needs to start at 1 to prevent division by zero.
16:06slashus2Another question. On my prime-factors function. It isn't an infinite lazy sequence all of the time, so the stack is blown if you try to go past the last value.
16:06slashus2This isn't good practice, I imagine.
16:09hiredman~clojurbeot joined, and suddenly...
16:09clojurebotCLABANGO!
16:09Lau_of_DKRaynes: Yea I think you did good on Euler :)
16:09RaynesThanks :D
16:10hiredman,(reduce + (distinct (concat (range 3 1000 3) (range 5 1000 5))))
16:10clojurebot233168
16:11hiredmanI guess that is cute
16:12Lau_of_DKSure is
16:17hiredman,((comp (partial reduce +) distinct (partial apply concat)) [(range 3 1000 3) (range 5 1000 5)])
16:17clojurebot233168
16:19durka42ok, now in the pl macro :)
16:20hiredman,(reduce + (set (concat (range 3 1000 3) (range 5 1000 5))))
16:20clojurebot233168
16:21hiredmanI really don't likae the concat and the two ranges
16:21Lau_of_DK,(+ 116584 116584)
16:21clojurebot233168
16:21Lau_of_DKquite obviously the best solution
16:22pjstadig~suddenly
16:22clojurebotCLABANGO!
16:26Lau_of_DKHmm, Anyway we can rename Clojure to RichBango! ?
16:26durka42no
16:26pjstadigclabango.com is available
16:27pjstadigsuprisingly
16:28danlarkinsomeone scoop it up quick before godaddy scrapes the logs and squats it
16:28pjstadignooo!
16:29pjstadigwait now you're for clabango?
16:30danlarkinI'm of two minds about it
16:30pjstadigi'm now the proud owner of clabango.com
16:31pjstadigbest $6.99 i ever spent
16:31danlarkinhahah
16:31durka42$6.99?
16:31Lau_of_DKCongratz man
16:31pjstadigexpensive?
16:31durka42no, cheap
16:31pjstadig1and1
16:31durka42ah
16:33cmvkkthat IS cheap.
16:34rsynnottyep, at that price, they'll be making their money entirely out of selling hosting and other services
16:35pjstadigor the parking pages on domains that people buy on a whim in an IRC session and never use
16:35danlarkinhaha
16:39hiredmanhmmmm
16:40hiredmanclojure.contrib.json.write prints lists and vectors the same way, that is less then ideal
16:40danlarkinprints them to json the same way?
16:40cmvkkis there...is there a difference in json?
16:41danlarkinjson has one list datatype: the array
16:52dnolenis it possible to write to a string as if it was a stream?
16:54Chouser,(with-out-str (prn :hi) (println "here we" [" " :go]))
16:54clojurebot":hi\nhere we [ :go]\n"
16:55dnolenChouser: but is it possible to get the stream object that represents the target string?
16:57Chouser,(with-out-str (print "*out* is now: " *out*))
16:57clojurebot"*out* is now: #<StringWriter *out* is now: #<StringWriter >"
16:59dnolenChouser: thanks!
17:00Chousernp
17:01tashafa#scala is funny
17:02bitbckttashafa: elaborate
17:03tashafamaybe not the place but .. http://www.nabble.com/-scala--URGENT%3A-Please-read-if-you-have-any-information-about-Tony-Morris-to22462911.html
17:11Lau_of_DKtashafa: There's no wrong place for something like that
17:13Raynes#Scala is boring.
17:13RaynesNever anyone there :|
17:13RaynesAnd when they are they are even boringer than when they aren't there.
17:15Ariens_Hyperionis there a follow up?
17:16RaynesThat message looks sincere
17:16danlarkinI believe he's complaining of a broken ankle
17:17danlarkinif it's a joke I don't find it very funny
17:17RaynesNor do I.
17:18Lau_of_DKhmm, danlarkin good someones away, it does appear he's suffering from a broken angle...
17:19Lau_of_DKs/away/awake
17:19RaynesLau_of_DK: It's 4:18 PM here.
17:21Ariens_Hyperionso he suicides because of a broken ankle?
17:22slashus2,(new java.util.Date)
17:22clojurebot#<Date Wed Mar 11 14:24:41 PDT 2009>
17:27RaynesThey are talking about Tony Morris in #Haskell-blah
17:28duncanmis tehre no dedicated predicate for testing null?
17:28duncanmempty? takes a Seq
17:28Cark,(doc nil?)
17:28clojurebot"([x]); Returns true if x is nil, false otherwise."
17:48sohailthat morris guy is athiest and has been miserable for the last little while b/c of his ankle. I've been reading his blog and apparently no one can figure it out
17:49sohailwell if it's the same morris anyway
17:53Lau_of_DKsohail: So youre impression is, that he is actually considering suicide?
17:53blbrownwow, a little drama in scala land
17:53WizardofWestmarcblbrown: eh?
17:53blbrownhttp://www.nabble.com/-scala--URGENT%3A-Please-read-if-you-have-any-information-about-Tony-Morris-to22462911.html
17:53blbrownWizardofWestmarc, he is a regular on #scala
17:54WizardofWestmarcoh my
17:54sohailLau_of_DK, not like I know him or anything so I can't say.. Just what I've said above
17:55Lau_of_DKk
17:56Ariens_HyperionI can't open his page, but I fint it a little strange that someone would quit because of an ankle.
17:57sohailYeah, I'm sure the ankle has nothing to do with it
17:58WizardofWestmarcIIRC most suicidal people live close to the edge and then some thing just pushes them over
18:00erohtarcould someone tell me how many agents I can start within a clojure process?
18:01Chousererohtar: an agent is not a thread -- you can have as many as will fit in memory.
18:02rsynnottsohail: how is it relevant that he's an atheist?
18:02rsynnott(aren't most educated people at least agnostic these days?)
18:02Ariens_Hyperionno
18:02bitbcktrsynnott: I was wondering the same thing.
18:02Chouserrsynnott: really not.
18:03erohtarchouser: so how does threading play into this?
18:05Chousererohtar: when you use 'send' or 'send-off', and agent will be assigned to a thread. There are different limits on the number of threads going at once.
18:05sohailrsynnott, rabid athiests I know are usually not very happy people
18:06Chouser...depending on whether you're using 'send' or 'send-off'
18:06erohtarchouser: say im using send
18:06erohtarchouser: what will happen if I send something to 300 agents?
18:07Chousererohtar: when you 'send' to an agent, the agent queues up waiting for a thread from a pool that's fixed based on the number of CPUs you have.
18:07erohtarchouser: and when the action completes successfully, does that associated thread get harvested?
18:08Chouserso in your example on a 2-core box, 4 agents would start running more or less immediately, and the other 296 will wait for one of the 4 to be done.
18:08rsynnottsohail: hasn't been my experience. It's a very popular idea (atheists being depressed/suicidal), but does not seem to be supported by actual studies or evidence
18:08Chousererohtar: yes, the thread gets assigned to the next queued agent, or goes idle.
18:08erohtarchouser: and how would this differ if i use send-off?
18:09bitbcktsohail: rabies does tend to make people unhappy
18:09Chouserthe pool used by 'send-off' grows as needed, to allow agents to block on IO.
18:09rsynnottanyway, rabies is treatable these days :)
18:09brianhsohail: i'd say rabid {atheist religious conservative liberal nra naacp ....} are usually not very happy people
18:09Chousererohtar: so if you send-off to 300 agents (and they each run long enough) it will try to create 300 threads.
18:10Chousererohtar: how well that ends up actually working on your system depends on lots of factors, as I'm sure you can imagine.
18:11rsynnottdoesn't Java have comparatively efficient cooperative threads, these days, in addition to standard OS threads?
18:11erohtarchouser: got it
18:11sohailrsynnott, I did not say I had scientific evidence and I would agree with brianh
18:11durka42does java have fake threads? i thought it just had OS threads
18:11erohtarchouser: and is there a way to increase the send ppol?
18:11Mecis there a function to merge 2 lists: (f '(1 2) '(3 4)) -> (1 2 3 4) there must be but i can't find it
18:12durka42concat
18:12Chousererohtar: I don't think so.
18:12Mecah hah
18:12Mecthanks
18:12sohailbrianh, my experience may be skewed as I have had more exposure to rabid athiests than rabid anything else
18:12rsynnottah, apparently java has abandoned 'green threads'
18:12AWizzArderohtar: but that does not limit you in any way. It is just a default value that makes sense.
18:13rsynnottI had a vague idea that it still used an erlang-like hybrid approach
18:13AWizzArdrsynnott: what for would you like to have green threads?
18:13durka42,(let [f concat] (f '(1 2) '(3 4)))
18:13clojurebot(1 2 3 4)
18:13erohtarchouser: ok - so if I were to use send-off - and as the 300 agents finish... would the threads reduce?
18:13rsynnottAWizzArd: cooperative threads or processes, if done correctly, are potentially very efficient
18:14AWizzArdrsynnott: but they would introduce at least a minimal overhead compared to have the functions running in serial in one thread.
18:14rsynnottAWizzArd: yep, they would
18:16Chousererohtar: the 'send-off' pool is created via java.util.concucurrent.Executors/newCachedThreadPool
18:16Chousererohtar: the javadoc says nothing about releasing idle threads, afaict.
18:16Chouseroh!
18:17Chouser"Threads that have not been used for sixty seconds are terminated and removed from the cache. Thus, a pool that remains idle for long enough will not consume any resources."
18:17Chouserso, "yes" :-)
18:17AWizzArdrsynnott: so their main use would be for human interaction with programs? Many people can interact at the same time, instead of just one?
18:17erohtarchouser: ok ... so that means using send-off for lots of agents that do complex computation is fine?
18:18ChouserI suppose, but if the work is CPU-bound, why would you want more than approx one thread per CPU?
18:18erohtarchouser: cause i want to be able to scale the processing service im using by increasing the number of threads
18:19Chouser'send' currently uses a pool of n+2 where n is the number of CPUs
18:19erohtarchouser: im thinking of using something like terracotta to increase the numbero of available CPUs
18:19rsynnottAWizzArd: potentially, for a useful abstraction over non-threaded asynchronous IO, for example
18:19rsynnott(this is SORT OF what erlang does)
18:19rsynnottthough those are green processes rather than threads
18:19Chousererohtar: ah, well, I don't know anything about how that would end up working. Let us know what you discover. :-)
18:19Mecanyone familiar with clojurebox or just emacs with clojure?
18:19AWizzArdyes, smaller footprint
18:20erohtarchouser: ok, will do! thanks!
18:20rsynnottMec: I use emacs and slime with clojure
18:22Mecrsynnott: I'm trying to figure out how to get the scratch buffer, or any buffer, to use the *slime-repl clojure* but M-x clojure-mode doesn't seem to do it
18:22WizardofWestmarcI think it's m-x slime
18:22rsynnottyou mean you want to switch to the slime-repl buffer?
18:22WizardofWestmarcthough it SHOULD be auto loading if you're using clojure box
18:23rsynnottM-x slime (or possibly slime-connect if you're using a free-standing swank server) should do it
18:24Mecwell it looks like there are 2 repls *slime-repl clojure* and *inferior-lisp* and running the clojure menu commands runs in the inferior-lisp which doesnt know any clojure functions
18:55RaynesDoes Rich have a beard?
18:55jhawk28no
18:55RaynesWere doomed.
18:55jhawk28at least not in the screencasts
18:56RaynesWe just had a discussion in #Haskell-Blah and came to the conclusion that languages do not become popular unless their creator has a beard.
18:56cmvkklarry wall never had a beard
18:56jhawk28there is always hope, Python and Ruby founders grew them
18:57RaynesWho's Larry Wall?
18:57cmvkkperl creator.
18:57Raynes'Nuff said.
18:57bitbcktthe Matz-beard is... lacking cred, imho
18:57cmvkkhey, it was popular at least
18:59Ariens_Hyperionthe beard is just a statistical side effect .
18:59Chousukeperhaps it is that a popular language causes beards to grow.
18:59bitbcktCorrelation != Causation
18:59cmvkkyes. let's not put the cart before the horse here.
18:59Chousukesome people just fight this by shaving.
18:59jhawk28http://www.xkcd.com/552/
19:00jhawk28today was a good day - Hacker News
19:01cmvkki, uh....wait, what?
19:04Ariens_Hyperiontoday was the erlang day
19:04Mecack how do you break a running emacs repl command
19:09Mecnhvm
19:10jhawk28I laughed about 15min about Hacker News
19:11jhawk28I have some implementation questions about adding a *read-eval* flag to the clojure
19:12jhawk28I was able to add the flag, but it does not have visibility of the flag at the reader level
19:13jhawk28so, I was thinking that I would need to set it as the reader parses, does this make sense or should I look for a different approach
19:13jhawk28*read-eval* effectivly disables a LispReader
19:16jhawk28or would the clojure group be a better place to post?
19:20Chousukeperhaps.
19:26jhawk28misstype, it should disable an EvalReader
19:31hiredmanjhawk28: I think you would set the flag before you call the reader
19:31jhawk28the issue is of scope
19:31jhawk28for exampler:
19:31hiredman(binding [*read-eval* false] (read untrusted-data))
19:32jhawk28(binding [*read-eval* false] #=(def x 3))
19:33jhawk28the when the #= is read, it does not have visibility of the false value of *read-eval*
19:34jhawk28pardon my grammar :)
19:37jhawk28here is an actual functional example: (binding [*read-eval* false] ) #=(eval (def x 3))
19:39Mecif you're expecting a list you can destruct it like (first & rest) right?
19:40ayrnieujhawk, the way to do this is to A) set *read-eval* is a prior form, or modify the reader in a prior form, B) implement the reader syntax as macros that you can disable, C) use your own reader, perhaps after factoring clojure's reader for reuse
19:41ayrnieujhawk - you can add read syntax specifically to control the reader, and this can work within a form, but when would you ever want to do this? Your own idea is pure madness.
19:42jhawk28agreed, it is madness :)
19:42ayrnieu,((fn [(a & b)] a) [1 2 3])
19:42clojurebotjava.lang.RuntimeException: java.lang.RuntimeException: java.lang.Exception: Unsupported binding form: (a & b)
19:43ayrnieu,((fn [[a & b]] a) '(1 2 3))
19:43clojurebot1
19:43Mec,((fn [[a & b]] b) '(1 2 3))
19:43clojurebot(2 3)
19:44Mecah excellent
19:58jhawk28:ayrnieu looking into it
20:06cooldude127why didn't anyone tell me about eclim? eclipse + vim = java love
20:17Drakeson(require 'java.net.URLConnection
20:17Drakesonoops!
20:19Drakesonhow can I access URLConnection? (require 'java.net.URLConnection) is apparently not the right way.
20:19durka42(import '[java.net URLConnection])
20:20Drakesonwhat is the first part (java.net) called in java terminology? the the whole thing (java.net.URLConnection) is a "java class".
20:21durka42not entirely sure
20:21durka42i would call java.net.URLConnection a "fully qualified class name"
20:27Drakesonwell, even (import '[java.net URLConnection]) is not working :(
20:28DrakesonI have sun-java6-jdk, sun-java6-jre, sun-java6-bin
20:28Drakesoncan you confirm whether it is working for you?
20:29Drakesonoops, nevermind
20:29Drakesonthanks a lot
20:29Drakesonit was all a very stupid mistake.
21:03durka42i can't find where vimclojure does C-w = but it's really annoying
21:03cooldude127durka42: i agree. i like my repl smaller
21:10cooldude127is it just the vimclojure prompt that doesn't show the current namespace? or is that just what the vanilla clojure repl does?
21:12durka42cooldude127: :set noequalalways
21:12durka42stops the flickering too
21:12cooldude127durka42: that's for the repl problem?
21:12cooldude127cool
21:12durka42yeah
21:13durka42yeah, it doesn't show the namespace
21:13durka42gorilla makes its own prompt
21:13cooldude127that's lame, i like seeing the namespace
21:13durka42i bet it wouldn't be too hard to hack in
21:14cooldude127it would for me. i'm just starting with vim
21:14durka42well, me too
21:14durka42i meant for someone who knew vimscript :)
21:14cooldude127lol
21:14durka42vimclojure does keep track of the current namespace, though
21:15cooldude127like in the file?
21:15durka42wait, that might be different
21:15cooldude127idk, what are you talking about?
21:15durka42there's b:vimclojure_namespace which i thought was about the REPL, but it looks like that's used for eval-file, so it might be the file instead
21:16cooldude127well that's kinda important for the eval commands, so they end up in the right ns
21:25cooldude127durka42: :set noequalalways didn't totally fix it. it still readjusted, it's just not equal
21:25cooldude127i think it had something to do with the preview window opening
21:28durka42hmm, fixed it for me. the preview window opens and closes on \p but the repl stays
21:28durka42maybe it has something to do with the settings i was fiddling with before
21:28cooldude127could be
21:31Drakesonhow do you inspect the constructor of a class in slime?
21:31DrakesonC-c I does not show me anything about the ctor
21:32Drakeson(I have the most recent slime)
21:33Drakesonalso, are there examples showing how to port some java code to clojure?
21:34duncanmDrakeson: is there a set way to do it?
21:34duncanmDrakeson: my understanding is that one doesn't write OO-style code in Clojure much
21:35cooldude127yeah you don't usually
21:35cooldude127functional code is what clojure's about
21:35duncanmi've been writing clojure for two weeks now, and only last night did i learn about gen-class
21:36Chouserduncanm: and now you're trying to un-learn it, aren't you.
21:36duncanmheh
21:36duncanmproxy is okay
21:36cooldude127genclass it usually unnecessary
21:36Chouseryes, proxy is much better, except when it's insufficient.
21:39cooldude127durka42: do you have anything like paredit for emacs in vim?
21:39durka42there is surround.vim
21:39durka42things like (cursor on open paren) ys%) to surround the form with parens
21:40durka42autoclose.vim does what it says but gets annoying sometimes
21:41cooldude127:( i love paredit
21:43Raynescooldude127: Use emacs.
21:44cooldude127i'm using vim to see what i'm missing
21:44Chousercooldude127: wow
21:44dnolencooldude127: that's a new one ;) emacs missing something? no...
21:45cooldude127not necessarily in features
21:45cooldude127but in the way it works
21:45ChouserI mean, I'm a habitual vim user, but I certainly have a bit of an inferiority complex.
21:45duncanmcooldude127: you like having modes?
21:45Chouseremacs has modes
21:45cooldude127not the same kind of modes
21:45Raynescooldude127: You're missing nothing.
21:46cooldude127duncanm: i'm not minding it so far
21:46Chousersure, it has the mode you're in immediately after pressing Meta-Something
21:46Chouserbut before you press something else
21:46cooldude127oh well i guess so
21:46duncanmcooldude127: other than that, i don't really see how it works differently
21:46duncanmhuh?
21:46powr-tocEmacs also has viper-mode for vi-like modes
21:46duncanmin emacs, there are commands and buffers, that's it
21:47duncanmM-x just opens a new buffer and put the point there
21:48Chouserctrl-w n does the same in vim
21:48duncanmChouser: not when you're in insert mode
21:49Raynes"Insert mode" is one of the things I dislike about Vim.
21:49cooldude127so far i'm liking vim, i'm just trying to get used to it
21:49duncanmRaynes: if you remove that, vim wouldn't be vim
21:49Chouserit's what I like most about vim, and would seek to emulate in emacs if/when I switch.
21:49RaynesOne more for commands and another for inserting is annowing.
21:50Raynesannoying*
21:50cooldude127i love the eclim (eclipse + vim) plugin so much
21:50dnolenpersonally I think the main reason to use emacs is SLIME, if it wasn't for that it really wouldn't matter, personally I can't wait till clojure-mode and swank-clojure get to the point that SLIME is at for Common Lisp, which is out of control.
21:50durka42cooldude127: are you using vimclojure along with eclim?
21:51RaynesI only use Emacs for Haskell.
21:51Chousercooldude127: I may have to try that. I've previously tried jvi + enclojure + netbeans.
21:51durka42cooldude127: and what parts of eclim are awesome?
21:52cooldude127durka42: it uses eclipse project management, and gives you java formatting, validation, and refactoring
21:52cooldude127takes care of ant support too
21:52cooldude127so it runs ant from the right directory
21:52durka42that helps
21:52cooldude127it takes all the good stuff from eclipse, and leaves out the suck, replacing it with vim
21:54cooldude127i can't stand editing java in eclipse, it's just unbearable.
21:55cooldude127navigation is such a pain
21:55cooldude127</rant>
21:57jhawk28just have to figure out the shortcuts
21:58jhawk28the problem with eclipse shortcuts is they can sometimes be very long
22:00cooldude127not fun. not fun at all
22:00cooldude127i used to be able to do it until i got used to emacs, and stopped using arrow keys
22:01jhawk28I want to get used to Emacs, but I can't remember the shortcuts
22:02dnolenjhawk28: http://users.ece.utexas.edu/~adnan/emacs-refcard.pdf
22:04jhawk28dnolen: thanks
22:04dnolennp
22:05cooldude127durka42: you use the shortcuts in the repl to go through the history?
22:06durka42yes, C-up and C-down
22:06durka42i remapped them to M-up and M-down because i have spaces on the control key
22:06cooldude127durka42: me too!
22:06cooldude127what were the commands you did?
22:07durka42in your vimrc
22:07durka42autocmd FileType * if &ft == "clojure" | imap <M-up> <Plug>ClojureReplUpHistory| endif
22:07durka42and the same for M-down and ClojureReplDownHistory
22:08durka42the above is magic -- kotarak arrived at it after much experimentation and i am not sure how it works
22:10Meccan you put a recur and the end of an and?
22:11ChouserMec: I would thinks so.
22:11cmvkkand is just a macro on top of if probably
22:12Chouser,(loop [i 5] (and (pos? i) (recur (dec i))))
22:12clojurebotfalse
22:12Mecexcellent, shouldn't matter if it's a loop or function right?
22:13cooldude127durka42: thanks
22:14cmvkkshouldn't matter.
22:15cmvkkhmm...using 'or' that way might be a concise way to return a value at the end of a loop
22:16ChouserMec: right.
22:16Mecyou'd need a pred that returns false or the value tho if i understand what your thinking
22:17cmvkkyeah, the value or nil more likely.
22:17cmvkki can't even think of a useful example off the top of my head though
22:17Mecya its basically just a while nil do sort of thing
22:19cmvkk,(loop [a '(nil nil 1 2 3)] (or (first a) (recur (next a))))
22:19clojurebot1
22:19cmvkkgets the first non-nil value.
22:19cmvkkthat's the best i can do.
22:19Mecyup thats what came to my mind, doesnt seem too useful
22:29jhawk28_what is the command to exit out of the repl?
22:29durka42emacs or vim?
22:29catch23does the Repl support a command-line option to pass in code directly as a string?
22:29duncanmcontrol-d?
22:30duncanmoh
22:30jhawk28_there is no function or macro like exit or quit?
22:30catch23jhawk28_: can always do the java exit :)
22:31duncanmRuntime/exit
22:31cooldude127System/exit
22:31durka42,close
22:31clojurebotjava.lang.Exception: Unable to resolve symbol: close in this context
22:32duncanmuser=> (.exit (Runtime/getRuntime) 0)
22:34jhawk28_I thought I was missing something
22:43Mecis there a way to get all the repl inputs and save them to a file?
22:45cooldude127Mec: use a good text editor
22:45Mecin emacs?
22:45cooldude127Mec: you could save the slime repl buffer to a file and then do some postprocessing to filter the lines
22:46Mecah ok
22:46durka42grep "^Clojure=>"
22:47durka42well unless it shows namespaces
22:47cooldude127durka42: slime buffer does
22:50duncanmslime doesn't support clojure debugging the same it does for CL, is that right?
22:59Mecis there a function: (f * 5 (range 1 10)) -> (5 10 15 20 25 ...)
22:59hiredmanreductions, I think it is somewhere in contrib
22:59durka42,(map (* 5 %) (range 1 10))
22:59Meci suppose i could (repeat 5)
22:59clojurebotarg literal not in #()
22:59durka42,(map #(* 5 %) (range 1 10))
22:59clojurebot(5 10 15 20 25 30 35 40 45)
23:00durka42heh, i'm writing python and i just thought "this needs to be in a transaction"
23:00Chousernice
23:01hiredmanI have been writing php all this afternoon
23:01durka42yuck
23:02hiredmanI have been writing a parser for a lisp with similar syntax to clojure
23:02cp2...in php?
23:02gnuvince_What does it mean "to chug"?
23:02Chousergnuvince_: depends on context
23:03durka42...as in a beverage?
23:03hiredmancp2: the idea being I can use this lisp in place of php
23:03cp2oh
23:03cp2then by all means
23:03cp2:)
23:03gnuvince_Can it mean "to move/displace/transport" something?
23:04gnuvince_Or am I confusing with another verb?
23:04Mecthere has to be a better way, this is kind of uggly:
23:04Mec,(mapcat (fn [n] (map #(* % n) (range 1 5))) (range 1 5))
23:04clojurebot(1 2 3 4 2 4 6 8 3 6 9 12 4 8 12 16)
23:04gnuvince_Mec: for?
23:04gnuvince_,(for [x (range 1 5) y (range 1 5)] (* x y))
23:04clojurebot(1 2 3 4 2 4 6 8 3 6 9 12 4 8 12 16)
23:05Mechey now, thats perfect
23:05gnuvince_:)
23:05Chousergnuvince_: a train might "chug", but that's the closest to transport I can think of.
23:05hiredman,(user 'clojure.contrib.seq_utils.clj)
23:05clojurebotjava.lang.Exception: Unable to resolve symbol: user in this context
23:05hiredman,(use 'clojure.contrib.seq_utils.clj)
23:05clojurebotjava.io.FileNotFoundException: Could not locate clojure/contrib/seq_utils/clj__init.class or clojure/contrib/seq_utils/clj.clj on classpath:
23:05hiredmanhmmm
23:05gnuvince_Okay, then it's not the word I'm looking for
23:05cp2i guess if something chugs along it could be with...great momentum ?
23:05cmvkkyou can use it metaphorically...to chug along
23:05durka42,(use 'clojure.contrib.seq-utils)
23:05clojurebotjava.io.FileNotFoundException: Could not locate clojure/contrib/seq_utils__init.class or clojure/contrib/seq_utils.clj on classpath:
23:06gnuvince_I'm talking about the C programming language and I want to call it a "memory mover/transporter/displacer/shuffler". Any suggestion?
23:06gnuvince_~seen rhickey
23:06clojurebotno, I have not seen rhickey
23:06cp2gnuvince_: then i guess "memory chugger
23:06cp2"
23:06hiredmanjava.lang.Exception: namespace 'clojure.contrib.seq_utils' not found after loading '/clojure/contrib/seq_utils'
23:06cp2isnt too fitting :)
23:07hiredmanoh
23:07hiredmandun
23:07hiredman-
23:07durka42hiredman: - _
23:07hiredman,(doc reductions)
23:07clojurebot"([f coll] [f init coll]); Returns a lazy seq of the intermediate values of the reduction (as per reduce) of coll by f, starting with init."
23:07gnuvince_cp2: do you have a suggestion?
23:07gnuvince_,`reductions
23:07clojurebotclojure.contrib.seq-utils/reductions
23:07hiredman,(reductions * 5 (range 1 10))
23:07clojurebot(5 5 10 30 120 600 3600 25200 201600 1814400)
23:08cp2uhm..other than "memory manager" "memory utility", even though those are kind of lame, not really
23:08gnuvince_cp2: I'd like a term that conveys a grunt task
23:08hiredmannope
23:08hiredmangnuvince_: memory humper
23:08cp2lol
23:08durka42clojurebot: do you suddenly have any ideas for us?
23:08clojurebotCLABANGO!
23:08hiredmanhumping gear is what grunts do
23:09hiredmanI have, a simple but more or less working reader
23:10hiredman"(defn f [x] x)" -> a linked list and [x] and array containing the symbol x
23:10hiredmanan
23:13Mec,(max '(1 2 3))
23:13clojurebot(1 2 3)
23:13Mecwhy?
23:13hiredman,(doc max)
23:13clojurebot"([x] [x y] [x y & more]); Returns the greatest of the nums."
23:13hiredman,(max 1 2 3)
23:13clojurebot3
23:14durka42,(apply max '(1 2 3))
23:14clojurebot3
23:14cmvkkthe greatest of alllll the nums
23:14hiredman,(apply max '(1 2 3))
23:14clojurebot3
23:14Mecright, i had to use apply, just wondering why it returned the list
23:14hiredman~def max
23:14Mecwow thats a neat feature
23:15Mecah ([x] x) that'll do it
23:16hiredmanI need to find some way to do it for clojure's java side
23:19hiredman~seen cooldude227
23:19clojurebotcooldude227 was last seen joining #clojure, 0 minutes ago
23:19cooldude127hi
23:20cooldude127oh well, i suppose i can just ignore it
23:25cooldude127this channel lacks excitement
23:26durka42~suddenly everything changes
23:26clojurebotCLABANGO!
23:26cooldude127wtf just happened
23:26durka42uh oh
23:26durka42cooldude127 might need to read some logs
23:27cooldude127durka42 might need to explain to cooldude127 what he's missing
23:27cooldude127:-p
23:28cmvkkfor all you guys have been throwing that word around, i haven't seen any actual software...
23:28durka42well there was another one of those exchanges in which Lau exhorts danlarkin to push his web framework to github and danlarkin pleads lack of name / lack of functionality
23:28durka42which turned into a debate over the name
23:28cooldude127hmmm...and the name is clabanga?
23:28cooldude127*clabango
23:28durka42and then we trained clojurebot to complete our jokes for us
23:28cooldude127lol
23:29durka42well, danlarkin is in favor of "madison"
23:29Chouser~It wasn't making any sense, and then suddenly...
23:29clojurebotCLABANGO!
23:29cooldude127haha
23:31cmvkkso there isn't actually going to be a famous piece of software called "Madison Square Clabango" in full? I find that vaguely disappointing...
23:31cooldude127oh that would be hilarious
23:31cmvkkand it's such a catchy and unforgettable name.
23:31cooldude127mhm
23:32cooldude127random question: anyone in here using irssi?
23:32cmvkkI am...but i don't really know anything about it
23:32replacacooldude127: me too
23:32cooldude127me neither, i just installed it tonight
23:32cooldude127i rather like it actually, tho i believe it has much more power than i'm aware of
23:33hiredmanI am as well
23:33replacacooldude127: Here is my link page, with just a few things: http://delicious.com/tomfaulhaber/irssi
23:34replacaI learned a bunch, but instantly forgot it
23:34cooldude127cool stuff
23:36jhawk28_I used to use irssi until I got Linkinus
23:36cooldude127replaca: actually that top link helped fix a problem i was having with iterm
23:40hiredmanugh
23:40hiredmanphp's object system is so horrible
23:40RaynesAbusing trampoline is fun.
23:42Mecany thoughts on simplifying: (apply and (for [x (range 1 21)] (divisible 200 x)))
23:42cooldude127Mec: the fact that it won't work
23:42cooldude127and is a macro, which you can't apply
23:43Mecwell then
23:43Mecany way to do that then ;p
23:43replacacooldude127: great, glad to help
23:43gnuvince_,(all #(zero (rem 200 %)) (range 1 21))
23:43clojurebotjava.lang.Exception: Unable to resolve symbol: all in this context
23:43gnuvince_,(all? #(zero (rem 200 %)) (range 1 21))
23:43clojurebotjava.lang.Exception: Unable to resolve symbol: all? in this context
23:43gnuvince_,(every? #(zero (rem 200 %)) (range 1 21))
23:43clojurebotjava.lang.Exception: Unable to resolve symbol: zero in this context
23:43gnuvince_,(every? #(zero? (rem 200 %)) (range 1 21))
23:43clojurebotfalse
23:43cooldude127,every
23:43clojurebotjava.lang.Exception: Unable to resolve symbol: every in this context
23:43cooldude127oh
23:43gnuvince_can you believe I sometimes use this language? ;)
23:43cooldude127lol
23:44gnuvince_Mec: that looks like a Euler problem, isn't it?
23:44Mecindeed
23:44gnuvince_finding the first integer that's evenly divisible by 1 to 20?
23:44Mecim working thru the problem set as a way to learn clojure
23:44cooldude127nobody does code like that for real stuff
23:44gnuvince_Mec: look into clojure.contrib.math/lcm instead
23:45gnuvince_You'll get an answer much more quickly
23:45Mecsure but that's cheating ;p
23:45hiredmanoh man
23:45cooldude127Mec: nothing's cheating
23:45cooldude127just get an answer :)
23:45hiredmanthis is too perfect, if only I can figure out how to use it
23:45Meccalling least common multiple is too easy
23:45cooldude127hiredman: share :)
23:45cooldude127Mec: well, yes this is true
23:45gnuvince_Mec: that's the "correct" answer
23:46gnuvince_,(reduce clojure.contrib.math/lcm (range 1 21))
23:46clojurebotjava.lang.ClassNotFoundException: clojure.contrib.math
23:46hiredmancooldude127: php objects have a magic __invoke method that gets called if you try to use them as a function
23:46cooldude127clojurebot doesn't have contrib
23:46cooldude127hiredman: they do!?
23:46gnuvince_ah
23:46cooldude127hiredman: i don't remember that. i remember some of the other magic methods but not that one
23:46Meci dont have contrib either, so that solves that problem ;p
23:47hiredmanso when I figure out how I am going to store functions I can just use that
23:47durka42that sounds rather useful actually
23:47cooldude127Mec: you should probably get contrib
23:47cooldude127life's easier that way
23:47cooldude127less wheel reinventing
23:47hiredmanIFns have about 20 invoke methods
23:48cooldude127wow
23:48cooldude127trying to prolong a varargs one?
23:49hiredman,(count (filter #(= % "invoke") (map #(.getName %) (.getMethods clojure.lang.IFn))))
23:49clojurebot22
23:49hiredmanYeah
23:50durka42the JVM crashed on me >:o
23:50hiredmanit happens
23:51durka42i called source after rebuilding clojure
23:52durka42so i assume it cached a file descriptor or something
23:52durka42that no longer existed