2009-03-11
| 00:01 | Raynes | I have a headache. |
| 00:01 | Raynes | I need to read |
| 00:01 | Raynes | It's hard to read with a headache. |
| 00:01 | Raynes | :( |
| 00:09 | hiredman | ? |
| 00:12 | cooldude127 | ok i have the nailgun server running, no idea how to get a repl |
| 00:16 | Raynes | Can 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:16 | Raynes | I'm not all to well on Clojure evaluation apparently, or I'm just missing something because of this horrible headache. |
| 00:18 | hiredman | things in the do happen one after the other |
| 00:18 | cooldude127 | Raynes: it looks like it should. after the first statement of the do occurs |
| 00:18 | Raynes | But from what I can see, wouldn't the evaluation start at the top once the do hit's the first recursion. |
| 00:19 | cmvkk | the 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:19 | Raynes | s/./?/ |
| 00:19 | hiredman | Raynes: but that recursion returns |
| 00:19 | Raynes | Oh that's neat. |
| 00:19 | Raynes | That's pretty damn cool. |
| 00:19 | Raynes | You guys explain things so well. <3 |
| 00:20 | cooldude127 | hiredman: i have a repl, but i get an error when i try to send a toplevel to it |
| 00:20 | cooldude127 | says couldn't execute nail |
| 00:21 | hiredman | ng needs to be in your path |
| 00:21 | cooldude127 | hiredman: it is |
| 00:22 | cooldude127 | hiredman: oh wait, i think i found the problem |
| 00:22 | cooldude127 | incompatible 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:23 | cooldude127 | so does the preview window open everytime i evaluate something |
| 00:25 | Raynes | cooldude127: Old nailguns have a tendency to backfire and shoot nails into your eyes. |
| 00:25 | Raynes | Always keep it uptodate. |
| 00:26 | cooldude127 | lol |
| 00:26 | replaca | what's nailgun? (besides the fun weapon from Quake) |
| 00:27 | ayrnieu | it's a construction device based on the Quake weapon. |
| 00:28 | sohail | lol |
| 00:28 | hiredman | I personally prefer a palm nailer |
| 00:28 | replaca | I don't think that's what folks are talking about! o-o |
| 00:50 | duncanm | i 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:52 | Raynes | duncanm: EMACS IS TEH BLOAT1!1 |
| 00:52 | duncanm | whatever |
| 00:53 | duncanm | you have like 2GB of RAM on your computer |
| 00:53 | Raynes | duncanm: It was a joke bro. |
| 00:53 | p_l | Raynes: 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:53 | duncanm | Raynes: yeah, but it's such a common refrain |
| 00:53 | Cark | and a 3Ghz computer, still emacs is dog slow =/ |
| 00:53 | Raynes | And I do have 2 GB on my computer... |
| 00:53 | Raynes | What's wrong with that... |
| 00:53 | p_l | Cark: byte compile ? |
| 00:53 | duncanm | Raynes: start menu/gnome-panel/osx's dock probably all use *more* memory than emacs by now |
| 00:54 | p_l | Raynes: cause Firefox is the king of bloat. My personal record was ~1.6G |
| 00:54 | Cark | p_l : actually i'm using emacs all the way, but it _is_ slow |
| 00:54 | duncanm | Cark: what is it slow at doing? |
| 00:54 | duncanm | and how many extensions do you use? |
| 00:54 | Cark | duncanm : writing a single very long line |
| 00:54 | p_l | Cark: can you break it? |
| 00:54 | duncanm | writing to where? |
| 00:55 | duncanm | in the terminal, in X? |
| 00:55 | Raynes | I 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:55 | hiredman | pfft, only ten? |
| 00:55 | Cark | in a console buffer |
| 00:55 | Raynes | hiredman: It's a slow night. |
| 00:55 | Raynes | Cark: GUI Emacs. |
| 00:55 | Cark | yes |
| 00:55 | Cark | i'm on windows ... |
| 00:56 | duncanm | there's a console version of emacs for windows? |
| 00:56 | cooldude127 | does vim have anything like emacs' paredit, where it always keeps parentheses matched |
| 00:56 | Raynes | duncanm: I believe so. |
| 00:56 | Cark | duncanm : there is one, i never used it though |
| 00:56 | Raynes | Somewhere... |
| 00:56 | p_l | Raynes: how long has your Firefox been running? certainly not two weeks :) |
| 00:56 | Raynes | p_l: 3 weeks. |
| 00:56 | duncanm | Cark: oh, if it's slow inside a buffer running cmd.exe, the problem might be somewhere else |
| 00:56 | Raynes | netbeans has been open for a whooping 12 days. |
| 00:57 | p_l | Raynes: wow. |
| 00:57 | Cark | nah that's an emacs problem ... anyways, i try to avoid it, but get bitten sometimes |
| 00:57 | Raynes | I'm surprised it's still running after 12 days. |
| 00:57 | duncanm | hmm |
| 00:57 | Cark | like cooldude i would like to give vim a chance |
| 00:57 | duncanm | i 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:57 | durka42 | cooldude127: autoclose.vim. gets annoying sometimes though. surround.vim has some of the structural editing keybindings but none of the automagic |
| 00:58 | Raynes | I gave Vim a chance, the editor is l33t but I prefer modes instead of scripts. |
| 00:58 | Cark | duncanm : i'm sold on emacs ... just whish it was a bit faster |
| 00:59 | duncanm | Cark: i'm really surprised that it's slow for you |
| 00:59 | Raynes | He's lying. |
| 00:59 | Cark | ! |
| 00:59 | Raynes | Cark: Just kidding bro <3 |
| 00:59 | Cark | =) |
| 01:00 | Raynes | Hey 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:00 | hiredman | http://groups.google.com/group/comp.lang.lisp/msg/81a24e488491e8ff <-- c.l.l posting on lisp+vim tips |
| 01:00 | Raynes | I like it the way it is. :-) |
| 01:01 | duncanm | Raynes: oh, well, you'll blow the stack if n is too big |
| 01:02 | duncanm | Raynes: if it were scheme, you'd be fine |
| 01:02 | Raynes | But a loop recur would be ugly :\ |
| 01:02 | Raynes | I think... |
| 01:02 | duncanm | Raynes: well, that's why we want TCO in the JVM |
| 01:02 | duncanm | once there's TCO in the JVM, loop/recur can go away |
| 01:03 | Chouser | but thankfully it won't. |
| 01:03 | Raynes | Hrm. |
| 01:03 | duncanm | Chouser: you're against it? |
| 01:04 | Chouser | no, I'm in favor of TCO, but I'm also in favor of loop/recur |
| 01:04 | duncanm | Chouser: well, of course - without TCO, loop/recur is the only way to go ;-P |
| 01:05 | Raynes | Chouser: Could you hold me? Just a little O.O |
| 01:05 | cooldude127 | loop recur is awesome |
| 01:05 | duncanm | huh? |
| 01:05 | duncanm | cooldude127: named LETs are even nicer |
| 01:05 | cooldude127 | great for when the loop arguments don't match the function arguments |
| 01:05 | cooldude127 | duncanm: i don't always feel like naming my helpers |
| 01:05 | duncanm | cooldude127: name it loop then |
| 01:06 | cooldude127 | at that point, why not just have the loop form? |
| 01:06 | cooldude127 | it makes it clear what the point is |
| 01:06 | Chouser | Even after TCO, I'll use 'recur' whenever I can. |
| 01:06 | duncanm | cooldude127: do you know about tail call optimization? |
| 01:06 | cooldude127 | yes |
| 01:06 | duncanm | Chouser: recur is a special macro that looks back? |
| 01:07 | Chouser | If I believe I'm in the tail position and use 'recur', the compiler will flag me if I'm wrong. |
| 01:07 | Chouser | 'recur' is a special form. |
| 01:07 | cooldude127 | TCO is great, but i don't really mind loop/recur |
| 01:07 | cooldude127 | and i love having it when the signatures don't match |
| 01:07 | cooldude127 | it's very succint |
| 01:07 | duncanm | what happens when the loops are nested? |
| 01:07 | cooldude127 | duncanm: actually, that has yet to come up for me |
| 01:07 | Chouser | recur is simple and explicit. It lets the reader know that I'm certain there won't be any stack overflow here. |
| 01:08 | hiredman | recur recurs to the closest frame |
| 01:08 | duncanm | one of the scary things one could do with named lets is that it allows you go jump to whichever label you want to |
| 01:08 | cooldude127 | well, i need sleep |
| 01:09 | hiredman | duncanm: that is mutual recursion, so you can use letfn or trampoline |
| 01:09 | Chouser | There are cases where recur is insufficient, so you still want TCO. |
| 01:09 | ayrnieu | (let 10 ... (let 20 ... (let 30 ... (goto 20) ... |
| 01:09 | duncanm | hiredman: loop/recur is basically a trampoline, isn't it? |
| 01:09 | ayrnieu | (this may require nonstandard indentation) |
| 01:10 | hiredman | duncanm: I dunno how it is represented in byte code |
| 01:10 | duncanm | ayrnieu: if you're writing Scheme, you can replace (goto 20) with (20 ...) |
| 01:10 | Cark | duncanm : more like a rebinding goto i think |
| 01:10 | Chouser | loop/recur is basically a while loop |
| 01:10 | Chouser | or yes, a goto |
| 01:10 | Chouser | compiles down to very efficient java bytecode |
| 01:11 | duncanm | http://lambda-the-ultimate.org/node/3106 |
| 01:11 | hiredman | trampoline on the other hand is a very simple function, who's source I just looked at today |
| 01:11 | hiredman | duncanm: trampoline and loop/recur are different mechanisms |
| 01:11 | ayrnieu | duncanm - tsk, I have higher standards of readability than that! |
| 01:12 | duncanm | hiredman: but the idea of a trampoline is just a loop (for, while) |
| 01:12 | duncanm | isn't it? |
| 01:12 | hiredman | ~def trampoline |
| 01:13 | hiredman | ,(doc trampoline) |
| 01:13 | clojurebot | "([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:13 | duncanm | hiredman: i wasn't referring to the clojure-specific definition |
| 01:13 | ayrnieu | hiredman, duncanm is talking about trampolines, not about the clojure function named 'trampoline'. |
| 01:13 | duncanm | * |
| 01:13 | duncanm | * Used in some LISP implementations, a trampoline is a loop that iteratively invokes thunk-returning functions. |
| 01:14 | Chouser | Clojure's loop/recur does not use thunks or closures of any kind. |
| 01:14 | duncanm | ok ok |
| 01:15 | Chouser | but it does avoid consuming stack frames, which trampolines also do. |
| 01:42 | slashus21 | Having (re-seq #"\w+" message) really screws up the code highlighting in enclojure |
| 01:43 | slashus21 | when you reload a dispatch function to a multimethod do you have to reload the (defmulti method too? |
| 01:43 | slashus21 | It seems to be the behavior |
| 01:49 | Raynes | Anyone 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:03 | catch23 | anyone know the proper way for doing object serialization on clojure objects? (sequences, maps etc) |
| 02:05 | catch23 | using 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:05 | maacl | Can 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:06 | Cark | catch32 : try printing with *print-readbly* bound to true |
| 02:06 | Cark | catch32 : then just read the string |
| 02:06 | hiredman | ,(doc prn) |
| 02:06 | clojurebot | "([& more]); Same as pr followed by (newline). Observes *flush-on-newline*" |
| 02:06 | hiredman | ugh |
| 02:07 | hiredman | ,(doc pr) |
| 02:07 | clojurebot | "([] [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:07 | Cark | ,(pr (sorted-map :a 1)) |
| 02:07 | clojurebot | {:a 1} |
| 02:07 | Cark | no good |
| 02:08 | Cark | you might want *print-dup* true i guess |
| 02:08 | Cark | ,(doc *print-dup*) |
| 02:08 | clojurebot | "; When set to logical true, objects will be printed in a way that preserves their type when read in later. Defaults to false." |
| 02:08 | hiredman | it depends |
| 02:08 | hiredman | I just use prn, because I don't really care what kind of hash I get back |
| 02:09 | catch23 | so 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:10 | hiredman | prn will try to print an object in a away that can be read by read |
| 02:10 | Cark | just keep in mind it won't work for java objects |
| 02:10 | Cark | and functions |
| 02:12 | catch23 | kk |
| 02:13 | hiredman | clojurebot: spin? |
| 02:13 | clojurebot | Titim gan �ir� ort. |
| 02:13 | hiredman | clojurebot: roulette |
| 02:13 | clojurebot | click |
| 02:13 | hiredman | clojurebot: roulette |
| 02:13 | clojurebot | click |
| 02:13 | hiredman | clojurebot: roulette |
| 02:13 | clojurebot | click |
| 02:13 | hiredman | clojurebot: roulette |
| 02:13 | clojurebot | click |
| 02:13 | hiredman | the suspense is killing me |
| 02:13 | hiredman | clojurebot: roulette |
| 02:13 | clojurebot | click |
| 02:13 | hiredman | clojurebot: roulette |
| 02:13 | clojurebot | click |
| 02:13 | hiredman | clojurebot: roulette |
| 02:13 | clojurebot | bang |
| 02:13 | hiredman | ! |
| 02:14 | cmvkk | oh god |
| 02:14 | cmvkk | now all you need is a trivia module. |
| 02:14 | cmvkk | and maybe a random dice throw. |
| 02:14 | hiredman | 1d4+3 |
| 02:14 | clojurebot | 6 |
| 02:16 | catch23 | Cark: you think prn is the same as doing .toString() on the object? |
| 02:16 | hiredman | it is not |
| 02:16 | hiredman | well |
| 02:16 | hiredman | actually |
| 02:17 | hiredman | ,(.toString {:a 1}) |
| 02:17 | clojurebot | "{:a 1}" |
| 02:17 | Raynes | ,(filter #(if (= (rem % 3) 0) true false) (range 1 1000)) |
| 02:17 | clojurebot | (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:17 | hiredman | I would not count on it being |
| 02:17 | hiredman | Raynes: you don't need the if |
| 02:17 | Raynes | I just realized that. |
| 02:17 | Raynes | It's a predicate -.- |
| 02:18 | Cark | catch32 : why would you use .toString ? |
| 02:18 | Raynes | My headache is easing, I should just go to bed, but I thought I'd solve Euler problem 1 before sleepytiem. |
| 02:18 | hiredman | Raynes: do it with for |
| 02:18 | hiredman | ~for |
| 02:18 | clojurebot | for is not used often enough |
| 02:19 | slashus21 | list comprehension is awesome |
| 02:19 | Raynes | But why ._. |
| 02:19 | hiredman | because for is way cool |
| 02:19 | Raynes | hiredman: is your single objective in life to make me stay up longer? :| |
| 02:20 | hiredman | ,(for [x (range 100) :when (= (rem x 3) 0)] x) |
| 02:20 | clojurebot | (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:21 | Raynes | Well now that you went ahead and ruined for me... |
| 02:23 | Raynes | (for [x (range 1 1000) :when (= (rem x 3) 0)] x) eureka. |
| 02:23 | Raynes | And I did it without looking at hiredmans :D |
| 02:24 | Raynes | Me go sleepy now. |
| 02:24 | cmvkk | i like that problem...it reminds me of FizzBuzz. |
| 02:24 | cmvkk | is there a clojure fizzbuzz solution repository somewhere? i hope so. |
| 09:07 | gnuvince | Hi |
| 09:07 | gnuvince | In EDT time, what time does Rich's QCon talk start? |
| 09:08 | gnuvince | It says 14:15 on the website, so that'd be 9:15 here? |
| 09:08 | marklar | gnuvince: its in london? |
| 09:08 | gnuvince | yeah |
| 09:09 | marklar | sounds right then :) |
| 09:09 | gnuvince | I was wondering if they have daylight saving time too |
| 09:09 | marklar | well, its 1pm there now |
| 09:10 | marklar | so I guess 1015 EST |
| 09:10 | marklar | is it being broadcast? |
| 09:35 | danlarkin | don't see links for streaming |
| 09:45 | cemerick | has anyone tried driving a browser DOM with clojure within an applet? |
| 09:48 | Chouser | cemerick: almost: http://clojurescript.n01se.net/ |
| 09:48 | Chouser | that includes an applet that provides functionality to some javascript which in turn drives the DOM |
| 09:48 | cemerick | Chouser: Too bad you can't distill all of our regular Java codebase down to javascript, too! |
| 09:48 | cemerick | ah, I didn't realize that |
| 09:49 | cemerick | Chouser: hrm, the applet fails to load for me. OS X, FF3 |
| 09:49 | Chouser | that javascript was produced from clojurescript sources, but that's probably beside the point of your question. |
| 09:49 | Chouser | yeah, none of my clojure applets work on Mac |
| 09:49 | Chouser | I haven't tracked down why yet. |
| 09:49 | cemerick | that's interesting |
| 09:52 | cemerick | oh, isn't the applet tag semi-deprecated? I thought object was the way to go these days... |
| 09:54 | cemerick | we 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:55 | Holcxjo | So, 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:56 | Holcxjo | I opted for the free option and will hear his talk at SkillsMatter to the London Java nerds... |
| 09:56 | StartsWithK | cemerick: jnlp from webstart is a way to go for applets |
| 09:57 | StartsWithK | also, while i didn't test this with clojure, proguad is something to try |
| 09:57 | cemerick | StartsWithK: the point is, we wouldn't be using swing for the UI -- that'd be entirely browser DOM |
| 09:57 | StartsWithK | it could minimize your applets to only copule of kb |
| 09:57 | cemerick | titanium is webkit wrapped up so that you can deploy a "rich browser-based application" as a self-contained thick client |
| 10:00 | StartsWithK | jnlp 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:00 | StartsWithK | just a suggestion |
| 10:01 | cemerick | StartsWithK: 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:02 | StartsWithK | maybe some other gui toolkit fo java |
| 10:05 | maacl | Could 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:07 | AWizzArd | maacl: why don't you want to use ant for compiling compojure? |
| 10:07 | AWizzArd | would it not be easier to simply cd into the compojure dir ant type "ant"? |
| 10:07 | maacl | AWizzArd: sorry expressing myself badly, want to compile the compojure example |
| 10:07 | maacl | AWizzArd: sorry |
| 10:08 | AWizzArd | what is your *compile-path*? |
| 10:09 | AWizzArd | ,*compile-path* |
| 10:09 | clojurebot | nil |
| 10:09 | AWizzArd | (binding [*compile-path* "/this/is/in/my/classpath/"] (compile 'my.module)) |
| 10:09 | maacl | "classes" |
| 10:10 | AWizzArd | And do you have a directory named classes on your system? |
| 10:10 | maacl | not at all |
| 10:10 | AWizzArd | I think it should at least be "/classes" |
| 10:10 | AWizzArd | tell me one directory that you have in your classpath pls |
| 10:11 | maacl | "/Users/mac/src/clojure/clojure.jar" |
| 10:11 | AWizzArd | In emacs do: (System/getProperty "java.class.path") |
| 10:11 | StartsWithK | cemerick: https://pivot.dev.java.net/ never can remeber the name.. |
| 10:11 | StartsWithK | looks nice, has that web 2.0 look |
| 10:12 | AWizzArd | maacl: 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:12 | StartsWithK | but it is underdocumanted and experimental(?) |
| 10:12 | maacl | AWizzArd: I get "/Users/mac/src/clojure/clojure.jar:/Users/mac/Development/lib/compojure/compojure.jar" |
| 10:12 | AWizzArd | okay, that means there are only two .jar files in your classpath, but not a directory. |
| 10:12 | maacl | right |
| 10:13 | AWizzArd | Make a dir in Vista, such as: /Users/mac/clj_build/ |
| 10:13 | AWizzArd | C:\Users\mac\clj_build |
| 10:13 | AWizzArd | gnuvince: oh, you wished me good luck too, I felt it. Thanks :) |
| 10:14 | maacl | AWizzArd: ok |
| 10:14 | gnuvince | AWizzArd: are you giving a talk? |
| 10:14 | AWizzArd | gnuvince: 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:15 | gnuvince | Damn |
| 10:15 | AWizzArd | maacl: 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:16 | AWizzArd | ;-) |
| 10:17 | AWizzArd | maacl: 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:17 | AWizzArd | ,(System/getProperty "java.class.path") |
| 10:17 | clojurebot | java.security.AccessControlException: access denied (java.util.PropertyPermission java.class.path read) |
| 10:19 | cemerick | StartsWithK: looks interesting. The "kitchen sink" demo fails to impress, unfortunately. |
| 10:19 | maacl | AWizzArd: I added "(swank-clojure-config (setq swank-clojure-extra-classpaths (list "~/src/jars")))" to .emacs but I still get the same result |
| 10:24 | AWizzArd | maacl: then this did not help. Delete this entry from your .emacs again. Instead look at http://paste.lisp.org/display/71211 |
| 10:24 | AWizzArd | in your .emacs you can find (custom-set-variables |
| 10:25 | AWizzArd | and then there are several things listed in there. Add '(swank-clojure-extra-classpaths "/path/clojure.jar" "/path/compojure.jar" "/Users/mac/clj_build/") |
| 10:29 | maacl | AWizzArd: ok |
| 10:33 | maacl | AWizzArd: still the same |
| 10:38 | gnuvince | If twitter is any indication, Rich's talk seems to be going well |
| 10:38 | gnuvince | " samaaron: Watching Ritch Hickey talk about Clojure at #QCon - very exciting stuff indeed :-) " |
| 10:42 | StartsWithK | will we get a video online? |
| 10:51 | maacl | AWizzArd: think I found the culprit : an old .emacs.elc file |
| 10:55 | AWizzArd | gnuvince: any comments about his hairstyle yet? ;) |
| 10:57 | maacl | AWizzArd: now I got the classpath working, but I still get the no sourcefile error |
| 11:00 | AWizzArd | maacl: did you use the binding? |
| 11:01 | maacl | AWizzArd: sorry, which binding? |
| 11:01 | maacl | AWizzArd: I use C-x C-e on the first expression |
| 11:02 | StartsWithK | lisppaste8: help |
| 11:02 | lisppaste8 | To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste. |
| 11:03 | lisppaste8 | StartsWithK pasted "Swing menu builder" at http://paste.lisp.org/display/76826 |
| 11:04 | cgrand | AWizzArd: no comment on the hairstyle yet. Ola Bini "Most of Rich Hickey's Clojure presentation finished at #qcon. As expected, it is excellent." |
| 11:04 | StartsWithK | shortcut for mnemonic and accelerator work for any javax.swing.AbstractButton, not just menu items |
| 11:07 | pjstadig | rich changed his hairstyle? |
| 11:07 | Chouser | cgrand: are you working on finger trees for clojure? |
| 11:08 | gnuvince | AWizzArd: whose? |
| 11:09 | cgrand | Chouser: nothing serious, just playing/learning at the moment. Why? |
| 11:09 | gnuvince | http://twitter.com/danny_l/status/1310947068 |
| 11:10 | Chouser | just curious. since rich mentioned them I've been meaning to read up, but haven't yet. |
| 11:12 | cgrand | I 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:15 | pjstadig | i think i studied finger trees |
| 11:15 | pjstadig | i forget |
| 11:15 | pjstadig | the thing i *do* remember from my graph algorithms class is splay trees |
| 11:19 | AWizzArd | maacl: binding *compile-path* to the path in which you want Clojure to put the resulting .class files. |
| 11:25 | maacl | AWizzArd: I get "java.lang.NoClassDefFoundError (index.clj:1)" |
| 11:26 | lisppaste8 | maacl pasted "index.clj" at http://paste.lisp.org/display/76828 |
| 11:27 | maacl | AWizzArd: just pasted what I am trying to compile |
| 11:32 | brianh | cgrand: would you mind pasting those two links? |
| 11:34 | cgrand | brianh: http://blog.sigfpe.com/2009/01/fast-incremental-regular-expression.html and http://apfelmus.nfshost.com/monoid-fingertree.html |
| 11:34 | brianh | cgrand: thx! |
| 11:39 | maacl | AWizzArd: using the binding gives me: "java.lang.NoClassDefFoundError (index.clj:1)" |
| 11:40 | durka42 | what is a monoid vs a monad? |
| 11:44 | Chousuke | the 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:44 | Chousuke | I'd say you're doing just fine if you can understand that. |
| 11:45 | cgrand | durka42: informally speaking a monoid is a function f of two args such that (= (f a (f b c)) (f (f a b) c)) |
| 11:46 | durka42 | okay |
| 11:47 | Chousuke | hmm |
| 11:51 | danlarkin | associativity! |
| 11:55 | maacl | AWizzArd: (all-ns) shows the compojure namespace - I really don't get this |
| 11:56 | cgrand | and 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:59 | Holcxjo | Well, the order of elements in the seq stil matters -- the order of evaluation doesn't, right? Being associative does not imply being commutative. |
| 12:00 | cgrand | Holcxjo: you're right |
| 12:02 | cgrand | and CouchDb requires reduce functions to be associative and commutative http://damienkatz.net/2008/02/incremental_map.html |
| 12:16 | maacl | AWizzArd: any further hints? otherwise thanks for the effort, really appreciated |
| 12:28 | stimuli | howdy |
| 12:28 | stimuli | is there a predicate to determine is a value can respond to seq ? |
| 12:29 | stimuli | so, it would return true for all collections, and false otherwise |
| 12:29 | AWizzArd | maacl: 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:29 | danlarkin | (doc coll?) |
| 12:29 | clojurebot | Returns true if x implements IPersistentCollection; arglists ([x]) |
| 12:29 | AWizzArd | try 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:30 | stimuli | danl : thanks |
| 12:33 | gnuvince | I'm getting a java.lang.VerifyError exception at line 0 in a Clojure file. What is that about? |
| 12:36 | leafw | gnuvince: recompile |
| 12:37 | gnuvince | ah |
| 12:37 | gnuvince | fixed it |
| 12:38 | maacl | AWizzArd: will give that a try |
| 12:39 | catch23 | there'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:40 | maacl | AWizzArd: 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:40 | catch23 | specifically, 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:40 | cemerick | catch23: (.someMethod obj #^Callable some-callable) should do it |
| 12:41 | catch23 | cemerick: ah ok thanks |
| 12:43 | AWizzArd | maacl: 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:44 | AWizzArd | maacl: 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:35 | maacl | AWizzArd: the simple.clj example works - I get simple$foo__1625.class simple.class and simple__init files in the correct directory |
| 13:42 | gnuvince | Was anyone at Rich's talk today? |
| 13:43 | Chouser | yeah, several people apparently. |
| 13:43 | Chouser | but I don't know if any of them are here. ;-) |
| 13:48 | WizardofWestmarc | Did Rich say if it was going to be recorded and posted online or not? |
| 13:48 | Chouser | I've not heard anyone mention that they're sure of either. |
| 13:50 | danlarkin | I'm quite sure it'll be online |
| 13:51 | danlarkin | don't know the schedule though |
| 13:52 | Chouser | oh, great. |
| 13:55 | WizardofWestmarc | if it takes a while that's fine, I just want it sooner or later :) |
| 13:55 | WizardofWestmarc | seems like every time I see one of Rich's talks I pick up something new |
| 13:56 | Raynes | Is there a function like map that applies a function to 2 elements from a sequence instead of just one at a time? |
| 13:57 | WizardofWestmarc | map |
| 13:57 | WizardofWestmarc | just give it two lists |
| 13:57 | WizardofWestmarc | (map func (a b c) (d e f)) |
| 13:58 | WizardofWestmarc | will call (func a d) (func b e) (func c f) |
| 14:04 | Chouser | ,(map + [1 2 3] [4 5 6]) |
| 14:04 | clojurebot | (5 7 9) |
| 14:05 | Chouser | ,(map (fn [[a b] (+ a b)]) (partition 2 [1 2 3 4 5 6])) |
| 14:05 | clojurebot | java.lang.RuntimeException: java.lang.RuntimeException: java.lang.Exception: Unsupported binding form: (+ a b) |
| 14:05 | Chouser | ,(map (fn [[a b]] (+ a b)) (partition 2 [1 2 3 4 5 6])) |
| 14:05 | clojurebot | (3 7 11) |
| 14:06 | WizardofWestmarc | ah ha, was trying to think of what function did that |
| 14:06 | WizardofWestmarc | it's partition |
| 14:06 | WizardofWestmarc | ,(partition 3 [1 2 3 4 5 6]) |
| 14:06 | clojurebot | ((1 2 3) (4 5 6)) |
| 14:08 | AWizzArd | maacl: 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:18 | maacl | AWizzArd: yeah, it breaks the moment i introduce :use compojure |
| 14:20 | spaceman_stu | speaking 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:23 | danlarkin | spaceman_stu: do you have the servlet-utils jar? |
| 14:24 | spaceman_stu | I'm betting it's a classpath thing. Thanks |
| 14:24 | leafw | anybody using vimclojure 2? Where should the local.properties go to? In the working dir, or the ~/.vim/ dir ? |
| 14:31 | durka42 | leafw: ant needs local.properties when building vimclojure |
| 14:31 | durka42 | put it in the same dir as build.xml |
| 14:32 | leafw | durka42: thanks |
| 14:32 | leafw | what I don't understand is why there isn't .jar included. |
| 14:32 | leafw | never mind |
| 14:45 | Lau_of_DK | Good evening gents |
| 14:45 | WizardofWestmarc | heya Lau, how goes? |
| 14:46 | Lau_of_DK | Times are interesting, my tasks at work that all require ~100% concentration :) You? |
| 14:53 | WizardofWestmarc | work day going by slowly |
| 14:53 | WizardofWestmarc | want to go home and hack on clojure |
| 14:54 | maacl | is the clojure.jar in compojure/deps broken ? |
| 14:54 | Lau_of_DK | WizardofWestmarc: Sounds familiar... from my old job :) |
| 14:55 | Lau_of_DK | maacl: No, but its probably very old |
| 14:55 | danlarkin | WizardofWestmarc: aye I'm with you on that |
| 14:55 | maacl | Lau_of_DK: ok, I get an error when I try to use it with swank |
| 14:56 | leafw | vimclojure 2.0 isbroken .. or not very well tested. It's a pitty really |
| 14:56 | leafw | I'd love to use it |
| 14:58 | WizardofWestmarc | how useable is compojure currently anyway? |
| 14:58 | WizardofWestmarc | I've been working on something in django but it's early enough would still be easy to change |
| 14:58 | hiredman | clojurebot: latest? |
| 14:58 | clojurebot | latest is [1327 "fixed seque"] |
| 14:58 | hiredman | clojurebot: latest is 1327 |
| 14:58 | clojurebot | c'est bon! |
| 14:59 | Lau_of_DK | WizardofWestmarc: Check out Madison Square Clabango then, Django port |
| 14:59 | Lau_of_DK | But on the other hand, Compojure is not letting me down |
| 15:00 | maacl | Lau_of_DK: I get java.lang.ExceptionInInitializerError (NO_SOURCE_FILE:0) ? any ideas |
| 15:03 | durka42 | leafw: are you referring to vimclojure after the merge with gorilla? |
| 15:03 | leafw | es |
| 15:03 | leafw | yes |
| 15:03 | durka42 | it's... a bit rocky |
| 15:03 | durka42 | under heavy development, shall we say |
| 15:03 | leafw | and the docs need chcking |
| 15:03 | durka42 | (not by me) |
| 15:04 | leafw | for example, is it let g:clj_wants_gorilla = 1 or let clj_wants_gorilla = 1 (without the g) ? |
| 15:04 | leafw | different parts of the docs say different things |
| 15:04 | durka42 | let g:clj_want_gorilla = 1 |
| 15:04 | durka42 | says my vimrc |
| 15:05 | leafw | makes sense, considering the previous let g:* commands |
| 15:05 | danlarkin | Lau_of_DK: you've got me saying clabango in my head, curse you! |
| 15:08 | leafw | durka42: also \p doesn't work, to close the scratch buffer |
| 15:08 | leafw | *sigh* |
| 15:09 | durka42 | bah, works for me :\ |
| 15:09 | durka42 | i'm not any kind of vim expert |
| 15:09 | hiredman | I have no idea what this localleader thing is or how it works |
| 15:09 | leafw | I am reasonably savvy with vim |
| 15:09 | Lau_of_DK | maacl: That can be anything, try checking where the files in the project are being initialized |
| 15:09 | Lau_of_DK | danlarkin: I appologize - But I guess now you know how I feel :) |
| 15:09 | leafw | the local leader is \ by default. |
| 15:09 | durka42 | well i assume leafw's localleader works if he got the preview window open |
| 15:09 | Lau_of_DK | Have you upped Madison Square Clabango on Github yet? |
| 15:09 | leafw | \ef works, but \p doesn't. |
| 15:10 | hiredman | leafw: so? what does it do? |
| 15:10 | durka42 | \p issued from the same window that \ef was |
| 15:10 | leafw | hiredman: \p should close the scratch buffer that any code evaluation opens. |
| 15:10 | leafw | durka42: I see. So its the other window which gets the focus though |
| 15:11 | leafw | also the editor locks up until the eval operation completes. |
| 15:11 | hiredman | erm, like :\p ? |
| 15:11 | durka42 | well, when i do \ef the preview window opens but focus stays in the window with the file |
| 15:11 | durka42 | hiredman: no, \ef in normal mode |
| 15:11 | leafw | durka42: now it did it -- not the first ime |
| 15:12 | durka42 | i 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:13 | danlarkin | Lau_of_DK: haven't had time to work on it in a handful of days, so no :-/ |
| 15:14 | leafw | oh wow the repl now works. |
| 15:14 | leafw | \sr, I had forgotten -- it never worked before |
| 15:14 | te | Lau_of_DK: Have you heard anything more about Madison Square Clabango> |
| 15:14 | te | I'd really like to play with it |
| 15:14 | durka42 | the repl is the best part :) |
| 15:15 | durka42 | by the way, careful -- i don't think the repl has a timeout yet |
| 15:16 | Lau_of_DK | te, danlarking who you see chatting in the channel right now, is the creator of Madison Square Clabango |
| 15:16 | leafw | the repl deletes a line with control+w+w, instead of switching windows ... |
| 15:16 | durka42 | C-ww in normal mode |
| 15:16 | Lau_of_DK | As I understand he's been a little lazy, but will recompense ASAP - so we can expect to see something on Github... when dan ? :) |
| 15:17 | te | danlarkin: Hola :) |
| 15:17 | leafw | durka42: I need some mental reworking, not used to a repl being an actual insert mode. |
| 15:17 | te | danlarkin: What's the word on Madison Square Clabango? |
| 15:19 | Lau_of_DK | danlarkin: We demand code! Upload Madison Square Clabango! :) |
| 15:19 | pjstadig | danlarkin: upload! |
| 15:19 | danlarkin | haha oh jeez |
| 15:19 | te | lol im sorry man |
| 15:19 | te | i just heard about your project and am anxious |
| 15:19 | te | i understand if you're not ready to release anything |
| 15:19 | Lau_of_DK | I dont |
| 15:19 | pjstadig | me either |
| 15:19 | danlarkin | well I just want to have reasonable test coverage before I upload |
| 15:19 | Lau_of_DK | Its a cool project, and you should get it up so we can contribute cool stuff and take over the web |
| 15:19 | te | lol well i really don't either |
| 15:19 | te | but for the sake of being cordial |
| 15:20 | durka42 | tough crowd today |
| 15:20 | te | i dont get no respect |
| 15:20 | pjstadig | yeah we want to take over the web with futuristic ninja robots |
| 15:20 | te | ^ |
| 15:20 | Lau_of_DK | yea "Rails was walking along one day, when suddenly, CLABANGO! hit him" |
| 15:20 | te | danlarkin: could i say one thing? |
| 15:20 | Lau_of_DK | Sounds awesome |
| 15:21 | te | danlarkin: madison square clabango is by far, the greatest name for a project -- EVER |
| 15:21 | pjstadig | agreed |
| 15:21 | danlarkin | te: no. way. |
| 15:21 | te | yes dude. yes. |
| 15:21 | te | im serious. it's so damn memorable i can't quit thinking about "clabango". |
| 15:21 | te | rails = boring. clabango = awesome. |
| 15:21 | Lau_of_DK | Truer words are rarely spoken |
| 15:21 | pjstadig | clojure on clabango |
| 15:22 | danlarkin | madison! |
| 15:22 | Lau_of_DK | Square! |
| 15:22 | te | im from madison |
| 15:22 | pjstadig | CLABANGO! |
| 15:22 | hiredman | Yawfie |
| 15:22 | te | i like squares |
| 15:22 | pjstadig | it's totally an action word |
| 15:23 | pjstadig | ZIP! |
| 15:23 | pjstadig | POW! |
| 15:23 | te | wtf is clabango anyway? |
| 15:23 | pjstadig | CLABANGO! |
| 15:23 | te | is it just a made up word? |
| 15:23 | slashus2 | clojure django? |
| 15:23 | te | ive googled clabango and all i could come up with is a log of this very irc channel talking about it |
| 15:23 | te | google whack |
| 15:23 | slashus2 | It seems that I remember uddering that one day. |
| 15:24 | te | uddering is awesome |
| 15:25 | Lau_of_DK | Clabango is going to be the next big thing.... |
| 15:25 | noidi | how can i do string interpolation in clojure? |
| 15:25 | te | yeah im fucking psyched |
| 15:25 | noidi | something like sprintf or python's % operator |
| 15:26 | te | im going to be making clabango shirts, hats, etc. |
| 15:26 | durka42 | (doc format) |
| 15:26 | clojurebot | Formats a string using java.lang.String.format, see java.util.Formatter for format string syntax; arglists ([fmt & args]) |
| 15:26 | noidi | thanks |
| 15:26 | Lau_of_DK | ,(format "hi subject # %d" 5) |
| 15:26 | clojurebot | "hi subject # 5" |
| 15:26 | te | clabango should be some kind of weird mascot |
| 15:27 | te | like an anteater with hi-tops for feet |
| 15:27 | te | not like -- wearing hi-tops, but literally, hi-tops for feet |
| 15:27 | durka42 | i'm thinking one of those clapping monkeys |
| 15:27 | te | yeah that's too obvious though |
| 15:27 | te | you need a weird twist on it |
| 15:27 | te | a clapping monkey with Ronald Reagen's face |
| 15:27 | danlarkin | I think I'm sticking with Madison... you guys are free to use clabango as your mascot |
| 15:28 | te | danlarkin: is it Madison Square clabango, or Madison^2 Clabango |
| 15:28 | slashus2 | clojure on acid |
| 15:28 | te | Clojure for Hardcore Drug Addicts |
| 15:28 | Lau_of_DK | danlarkin: You dont have to tell me twice |
| 15:29 | Lau_of_DK | http://github.com/Lau-of-DK/clabango/tree/master |
| 15:29 | Chouser | you'd own the google search space for clabango. Not true of madison. |
| 15:29 | danlarkin | hahah |
| 15:29 | rsynnott | te: spitting image ronald reagan, or real ronald reagan |
| 15:29 | rsynnott | ? |
| 15:29 | Lau_of_DK | te, 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:30 | te | rsynnott: real ronald reagan |
| 15:30 | te | rsynnott: as a clapping cymbal monkey |
| 15:30 | rsynnott | hopefully from at least a few years ago; it is unlikely that he has much face to speak of at this point |
| 15:30 | Raynes | I just discovered trampoline :> |
| 15:31 | slashus2 | bounce bounce bounce |
| 15:31 | pjstadig | seriously. clabango. |
| 15:32 | rsynnott | what is clabango, anyway? |
| 15:32 | durka42 | pjstadig: 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:32 | pjstadig | hehe |
| 15:33 | Lau_of_DK | yea, thats the big question |
| 15:33 | te | let me tell you what clabango is: |
| 15:33 | te | awesome. |
| 15:33 | Lau_of_DK | When is TerraBango ready for primetime? |
| 15:33 | pjstadig | i'm smoothing out the interactions with multiple REPLs |
| 15:33 | danlarkin | Lau_of_DK: oh jeez, terrabango... |
| 15:33 | te | Mr. Clabango |
| 15:33 | pjstadig | i'm getting a weird NPE in BitmapIndexedNode when I def in a REPL that was reconnected to the cluster |
| 15:34 | pjstadig | the NPE goes away after doing a (ns-map 'user) |
| 15:34 | pjstadig | i think i'm not configuring TC correctly or something |
| 15:34 | durka42 | so terracotta is like not loading everything right away? |
| 15:35 | pjstadig | what do you mean? |
| 15:35 | durka42 | ns-map seems like it would be doing something akin to a dorun |
| 15:35 | pjstadig | right |
| 15:35 | hiredman | ,(doc ns-map) |
| 15:35 | clojurebot | "([ns]); Returns a map of all the mappings for the namespace." |
| 15:35 | pjstadig | yeah TC works like a virtual memory |
| 15:36 | pjstadig | if it's not in your VM and you try to get it, then it gets brought to your VM |
| 15:36 | durka42 | but def is assuming it's there when it isn't yet |
| 15:36 | pjstadig | but according to the TC site you should only get an NPE for uninstrumented code |
| 15:36 | pjstadig | which shouldn't be the case |
| 15:36 | durka42 | hrmm |
| 15:37 | pjstadig | i'm trying to learn TC and the internals of Clojure at the same time, so it's a challenge |
| 15:37 | pjstadig | interesting tho |
| 15:39 | pjstadig | CLABANGOCOTTA! |
| 15:39 | durka42 | i think TerraBango's better |
| 15:39 | pjstadig | oh |
| 15:40 | pjstadig | i might have fixed the NPE |
| 15:40 | pjstadig | yeah |
| 15:41 | pjstadig | the problem appears to have been that BIN clones it's node array instead of creating a new one and doing an arraycopy |
| 15:41 | durka42 | you say that now, until later... it comes back when you LEAST expect it... and then *vanishes* without a backtrace |
| 15:42 | pjstadig | i 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:42 | pjstadig | man that sucked |
| 15:43 | Lau_of_DK | I know the feeling, you try to get some real work done, and suddenly, CLABANGO! you set back a week |
| 15:44 | hiredman | clojurebot: suddenly is <reply>CLABANGO! |
| 15:44 | clojurebot | 'Sea, mhuise. |
| 15:45 | durka42 | clojurebot: i was walking in the park, when suddenly... |
| 15:45 | clojurebot | CLABANGO! |
| 15:45 | pjstadig | hehe |
| 15:45 | durka42 | gotta love that fuzzy matching |
| 15:45 | te | clojurebot: I was just frolicking around in a field of black eyed susans, when out of nowhere, suddenly... |
| 15:45 | clojurebot | CLABANGO! |
| 15:47 | Lau_of_DK | haha |
| 15:47 | Lau_of_DK | niceness |
| 15:48 | te | clojurebot: 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:48 | clojurebot | one is B |
| 15:49 | te | clojurebot: forget one |
| 15:49 | clojurebot | I forgot one |
| 15:49 | te | clojurebot: 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:49 | clojurebot | ring is http://github.com/mmcgrana/ring/tree/master |
| 15:49 | te | damnit |
| 15:49 | Chouser | hehe |
| 15:50 | hiredman | clojurebot: botsnack |
| 15:50 | clojurebot | thanks; that was delicious. (nom nom nom) |
| 15:50 | Raynes | ,(reduce + (for [x (range 1000) :when (or (zero? (rem x first-num)) (zero? (rem x second-num)))] x))) |
| 15:50 | clojurebot | java.lang.Exception: Unable to resolve symbol: first-num in this context |
| 15:51 | Raynes | Oops :> |
| 15:51 | Raynes | That's what you get for copypasting code straight from a function. |
| 15:51 | Raynes | ,(reduce + (for [x (range 1000) :when (or (zero? (rem x 3)) (zero? (rem x 5)))] x))) |
| 15:51 | clojurebot | 233168 |
| 15:51 | Raynes | Project euler problem one: Complete. |
| 15:51 | Lau_of_DK | lol |
| 15:52 | hiredman | it's too bad about that reduce on the outside |
| 15:53 | Lau_of_DK | ,(reduce + (distinct (concat (range 3 1000 3) (range 5 1000 5)))) |
| 15:53 | clojurebot | java.lang.NoClassDefFoundError: clojure/core$distinct__4588$step__4590 |
| 15:53 | durka42 | erp? |
| 15:53 | Lau_of_DK | Thats no good, its from the clojure-euler.wikispaces.com |
| 15:53 | Raynes | hiredman: I'm fixing that as we speak. |
| 15:55 | hiredman | clojurebot may be broken |
| 15:55 | Raynes | Works on my REPL |
| 15:55 | Raynes | I like my implementation better :> |
| 15:55 | hiredman | yeah |
| 15:56 | Raynes | Considering 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:56 | shoover | thanks for the enthralling hype around Clabango, folks. In a day of tough bug fixing, that's quality entertainment! |
| 15:57 | danlarkin | hahh |
| 15:58 | shoover | danlarkin: laughing is for closers. get back to work until the code is pushed |
| 15:58 | danlarkin | :( yessir |
| 15:59 | lisppaste8 | slashus2 pasted "tail recursion?" at http://paste.lisp.org/display/76850 |
| 16:00 | slashus2 | I 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:00 | slashus2 | next to the last function |
| 16:01 | Raynes | slashus2: The last function is inside the loop after the recur. |
| 16:01 | slashus2 | Raynes: hum? |
| 16:01 | Raynes | Add another parenthesis on the end of the recur line and remove one from the last line. |
| 16:02 | slashus2 | I wanted the recur to be conditional so I can terminate. |
| 16:02 | durka42 | because the function needs the result of the recur to feed into the if |
| 16:02 | te | I hear clabango implements hidden markovs to somehow guess at the code you're going to write |
| 16:03 | durka42 | oh, wait, no |
| 16:03 | Raynes | There is another function call after the recur. |
| 16:03 | dnolen | slashu2: the result, real-prime-factors, is not in the if statement |
| 16:03 | danlarkin | te: correct |
| 16:04 | slashus2 | yey |
| 16:04 | slashus2 | thank you |
| 16:04 | slashus2 | that was it! |
| 16:05 | slashus2 | pos-prime-fact needs to start at 1 to prevent division by zero. |
| 16:06 | slashus2 | Another 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:06 | slashus2 | This isn't good practice, I imagine. |
| 16:09 | hiredman | ~clojurbeot joined, and suddenly... |
| 16:09 | clojurebot | CLABANGO! |
| 16:09 | Lau_of_DK | Raynes: Yea I think you did good on Euler :) |
| 16:09 | Raynes | Thanks :D |
| 16:10 | hiredman | ,(reduce + (distinct (concat (range 3 1000 3) (range 5 1000 5)))) |
| 16:10 | clojurebot | 233168 |
| 16:11 | hiredman | I guess that is cute |
| 16:12 | Lau_of_DK | Sure is |
| 16:17 | hiredman | ,((comp (partial reduce +) distinct (partial apply concat)) [(range 3 1000 3) (range 5 1000 5)]) |
| 16:17 | clojurebot | 233168 |
| 16:19 | durka42 | ok, now in the pl macro :) |
| 16:20 | hiredman | ,(reduce + (set (concat (range 3 1000 3) (range 5 1000 5)))) |
| 16:20 | clojurebot | 233168 |
| 16:21 | hiredman | I really don't likae the concat and the two ranges |
| 16:21 | Lau_of_DK | ,(+ 116584 116584) |
| 16:21 | clojurebot | 233168 |
| 16:21 | Lau_of_DK | quite obviously the best solution |
| 16:22 | pjstadig | ~suddenly |
| 16:22 | clojurebot | CLABANGO! |
| 16:26 | Lau_of_DK | Hmm, Anyway we can rename Clojure to RichBango! ? |
| 16:26 | durka42 | no |
| 16:26 | pjstadig | clabango.com is available |
| 16:27 | pjstadig | suprisingly |
| 16:28 | danlarkin | someone scoop it up quick before godaddy scrapes the logs and squats it |
| 16:28 | pjstadig | nooo! |
| 16:29 | pjstadig | wait now you're for clabango? |
| 16:30 | danlarkin | I'm of two minds about it |
| 16:30 | pjstadig | i'm now the proud owner of clabango.com |
| 16:31 | pjstadig | best $6.99 i ever spent |
| 16:31 | danlarkin | hahah |
| 16:31 | durka42 | $6.99? |
| 16:31 | Lau_of_DK | Congratz man |
| 16:31 | pjstadig | expensive? |
| 16:31 | durka42 | no, cheap |
| 16:31 | pjstadig | 1and1 |
| 16:31 | durka42 | ah |
| 16:33 | cmvkk | that IS cheap. |
| 16:34 | rsynnott | yep, at that price, they'll be making their money entirely out of selling hosting and other services |
| 16:35 | pjstadig | or the parking pages on domains that people buy on a whim in an IRC session and never use |
| 16:35 | danlarkin | haha |
| 16:39 | hiredman | hmmmm |
| 16:40 | hiredman | clojure.contrib.json.write prints lists and vectors the same way, that is less then ideal |
| 16:40 | danlarkin | prints them to json the same way? |
| 16:40 | cmvkk | is there...is there a difference in json? |
| 16:41 | danlarkin | json has one list datatype: the array |
| 16:52 | dnolen | is it possible to write to a string as if it was a stream? |
| 16:54 | Chouser | ,(with-out-str (prn :hi) (println "here we" [" " :go])) |
| 16:54 | clojurebot | ":hi\nhere we [ :go]\n" |
| 16:55 | dnolen | Chouser: but is it possible to get the stream object that represents the target string? |
| 16:57 | Chouser | ,(with-out-str (print "*out* is now: " *out*)) |
| 16:57 | clojurebot | "*out* is now: #<StringWriter *out* is now: #<StringWriter >" |
| 16:59 | dnolen | Chouser: thanks! |
| 17:00 | Chouser | np |
| 17:01 | tashafa | #scala is funny |
| 17:02 | bitbckt | tashafa: elaborate |
| 17:03 | tashafa | maybe not the place but .. http://www.nabble.com/-scala--URGENT%3A-Please-read-if-you-have-any-information-about-Tony-Morris-to22462911.html |
| 17:11 | Lau_of_DK | tashafa: There's no wrong place for something like that |
| 17:13 | Raynes | #Scala is boring. |
| 17:13 | Raynes | Never anyone there :| |
| 17:13 | Raynes | And when they are they are even boringer than when they aren't there. |
| 17:15 | Ariens_Hyperion | is there a follow up? |
| 17:16 | Raynes | That message looks sincere |
| 17:16 | danlarkin | I believe he's complaining of a broken ankle |
| 17:17 | danlarkin | if it's a joke I don't find it very funny |
| 17:17 | Raynes | Nor do I. |
| 17:18 | Lau_of_DK | hmm, danlarkin good someones away, it does appear he's suffering from a broken angle... |
| 17:19 | Lau_of_DK | s/away/awake |
| 17:19 | Raynes | Lau_of_DK: It's 4:18 PM here. |
| 17:21 | Ariens_Hyperion | so he suicides because of a broken ankle? |
| 17:22 | slashus2 | ,(new java.util.Date) |
| 17:22 | clojurebot | #<Date Wed Mar 11 14:24:41 PDT 2009> |
| 17:27 | Raynes | They are talking about Tony Morris in #Haskell-blah |
| 17:28 | duncanm | is tehre no dedicated predicate for testing null? |
| 17:28 | duncanm | empty? takes a Seq |
| 17:28 | Cark | ,(doc nil?) |
| 17:28 | clojurebot | "([x]); Returns true if x is nil, false otherwise." |
| 17:48 | sohail | that 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:49 | sohail | well if it's the same morris anyway |
| 17:53 | Lau_of_DK | sohail: So youre impression is, that he is actually considering suicide? |
| 17:53 | blbrown | wow, a little drama in scala land |
| 17:53 | WizardofWestmarc | blbrown: eh? |
| 17:53 | blbrown | http://www.nabble.com/-scala--URGENT%3A-Please-read-if-you-have-any-information-about-Tony-Morris-to22462911.html |
| 17:53 | blbrown | WizardofWestmarc, he is a regular on #scala |
| 17:54 | WizardofWestmarc | oh my |
| 17:54 | sohail | Lau_of_DK, not like I know him or anything so I can't say.. Just what I've said above |
| 17:55 | Lau_of_DK | k |
| 17:56 | Ariens_Hyperion | I can't open his page, but I fint it a little strange that someone would quit because of an ankle. |
| 17:57 | sohail | Yeah, I'm sure the ankle has nothing to do with it |
| 17:58 | WizardofWestmarc | IIRC most suicidal people live close to the edge and then some thing just pushes them over |
| 18:00 | erohtar | could someone tell me how many agents I can start within a clojure process? |
| 18:01 | Chouser | erohtar: an agent is not a thread -- you can have as many as will fit in memory. |
| 18:02 | rsynnott | sohail: how is it relevant that he's an atheist? |
| 18:02 | rsynnott | (aren't most educated people at least agnostic these days?) |
| 18:02 | Ariens_Hyperion | no |
| 18:02 | bitbckt | rsynnott: I was wondering the same thing. |
| 18:02 | Chouser | rsynnott: really not. |
| 18:03 | erohtar | chouser: so how does threading play into this? |
| 18:05 | Chouser | erohtar: 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:05 | sohail | rsynnott, rabid athiests I know are usually not very happy people |
| 18:06 | Chouser | ...depending on whether you're using 'send' or 'send-off' |
| 18:06 | erohtar | chouser: say im using send |
| 18:06 | erohtar | chouser: what will happen if I send something to 300 agents? |
| 18:07 | Chouser | erohtar: 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:07 | erohtar | chouser: and when the action completes successfully, does that associated thread get harvested? |
| 18:08 | Chouser | so 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:08 | rsynnott | sohail: 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:08 | Chouser | erohtar: yes, the thread gets assigned to the next queued agent, or goes idle. |
| 18:08 | erohtar | chouser: and how would this differ if i use send-off? |
| 18:09 | bitbckt | sohail: rabies does tend to make people unhappy |
| 18:09 | Chouser | the pool used by 'send-off' grows as needed, to allow agents to block on IO. |
| 18:09 | rsynnott | anyway, rabies is treatable these days :) |
| 18:09 | brianh | sohail: i'd say rabid {atheist religious conservative liberal nra naacp ....} are usually not very happy people |
| 18:09 | Chouser | erohtar: so if you send-off to 300 agents (and they each run long enough) it will try to create 300 threads. |
| 18:10 | Chouser | erohtar: how well that ends up actually working on your system depends on lots of factors, as I'm sure you can imagine. |
| 18:11 | rsynnott | doesn't Java have comparatively efficient cooperative threads, these days, in addition to standard OS threads? |
| 18:11 | erohtar | chouser: got it |
| 18:11 | sohail | rsynnott, I did not say I had scientific evidence and I would agree with brianh |
| 18:11 | durka42 | does java have fake threads? i thought it just had OS threads |
| 18:11 | erohtar | chouser: and is there a way to increase the send ppol? |
| 18:11 | Mec | is 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:12 | durka42 | concat |
| 18:12 | Chouser | erohtar: I don't think so. |
| 18:12 | Mec | ah hah |
| 18:12 | Mec | thanks |
| 18:12 | sohail | brianh, my experience may be skewed as I have had more exposure to rabid athiests than rabid anything else |
| 18:12 | rsynnott | ah, apparently java has abandoned 'green threads' |
| 18:12 | AWizzArd | erohtar: but that does not limit you in any way. It is just a default value that makes sense. |
| 18:13 | rsynnott | I had a vague idea that it still used an erlang-like hybrid approach |
| 18:13 | AWizzArd | rsynnott: what for would you like to have green threads? |
| 18:13 | durka42 | ,(let [f concat] (f '(1 2) '(3 4))) |
| 18:13 | clojurebot | (1 2 3 4) |
| 18:13 | erohtar | chouser: ok - so if I were to use send-off - and as the 300 agents finish... would the threads reduce? |
| 18:13 | rsynnott | AWizzArd: cooperative threads or processes, if done correctly, are potentially very efficient |
| 18:14 | AWizzArd | rsynnott: but they would introduce at least a minimal overhead compared to have the functions running in serial in one thread. |
| 18:14 | rsynnott | AWizzArd: yep, they would |
| 18:16 | Chouser | erohtar: the 'send-off' pool is created via java.util.concucurrent.Executors/newCachedThreadPool |
| 18:16 | Chouser | erohtar: the javadoc says nothing about releasing idle threads, afaict. |
| 18:16 | Chouser | oh! |
| 18:17 | Chouser | "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:17 | Chouser | so, "yes" :-) |
| 18:17 | AWizzArd | rsynnott: so their main use would be for human interaction with programs? Many people can interact at the same time, instead of just one? |
| 18:17 | erohtar | chouser: ok ... so that means using send-off for lots of agents that do complex computation is fine? |
| 18:18 | Chouser | I suppose, but if the work is CPU-bound, why would you want more than approx one thread per CPU? |
| 18:18 | erohtar | chouser: cause i want to be able to scale the processing service im using by increasing the number of threads |
| 18:19 | Chouser | 'send' currently uses a pool of n+2 where n is the number of CPUs |
| 18:19 | erohtar | chouser: im thinking of using something like terracotta to increase the numbero of available CPUs |
| 18:19 | rsynnott | AWizzArd: potentially, for a useful abstraction over non-threaded asynchronous IO, for example |
| 18:19 | rsynnott | (this is SORT OF what erlang does) |
| 18:19 | rsynnott | though those are green processes rather than threads |
| 18:19 | Chouser | erohtar: ah, well, I don't know anything about how that would end up working. Let us know what you discover. :-) |
| 18:19 | Mec | anyone familiar with clojurebox or just emacs with clojure? |
| 18:19 | AWizzArd | yes, smaller footprint |
| 18:20 | erohtar | chouser: ok, will do! thanks! |
| 18:20 | rsynnott | Mec: I use emacs and slime with clojure |
| 18:22 | Mec | rsynnott: 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:22 | WizardofWestmarc | I think it's m-x slime |
| 18:22 | rsynnott | you mean you want to switch to the slime-repl buffer? |
| 18:22 | WizardofWestmarc | though it SHOULD be auto loading if you're using clojure box |
| 18:23 | rsynnott | M-x slime (or possibly slime-connect if you're using a free-standing swank server) should do it |
| 18:24 | Mec | well 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:55 | Raynes | Does Rich have a beard? |
| 18:55 | jhawk28 | no |
| 18:55 | Raynes | Were doomed. |
| 18:55 | jhawk28 | at least not in the screencasts |
| 18:56 | Raynes | We 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:56 | cmvkk | larry wall never had a beard |
| 18:56 | jhawk28 | there is always hope, Python and Ruby founders grew them |
| 18:57 | Raynes | Who's Larry Wall? |
| 18:57 | cmvkk | perl creator. |
| 18:57 | Raynes | 'Nuff said. |
| 18:57 | bitbckt | the Matz-beard is... lacking cred, imho |
| 18:57 | cmvkk | hey, it was popular at least |
| 18:59 | Ariens_Hyperion | the beard is just a statistical side effect . |
| 18:59 | Chousuke | perhaps it is that a popular language causes beards to grow. |
| 18:59 | bitbckt | Correlation != Causation |
| 18:59 | cmvkk | yes. let's not put the cart before the horse here. |
| 18:59 | Chousuke | some people just fight this by shaving. |
| 18:59 | jhawk28 | http://www.xkcd.com/552/ |
| 19:00 | jhawk28 | today was a good day - Hacker News |
| 19:01 | cmvkk | i, uh....wait, what? |
| 19:04 | Ariens_Hyperion | today was the erlang day |
| 19:04 | Mec | ack how do you break a running emacs repl command |
| 19:09 | Mec | nhvm |
| 19:10 | jhawk28 | I laughed about 15min about Hacker News |
| 19:11 | jhawk28 | I have some implementation questions about adding a *read-eval* flag to the clojure |
| 19:12 | jhawk28 | I was able to add the flag, but it does not have visibility of the flag at the reader level |
| 19:13 | jhawk28 | so, 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:13 | jhawk28 | *read-eval* effectivly disables a LispReader |
| 19:16 | jhawk28 | or would the clojure group be a better place to post? |
| 19:20 | Chousuke | perhaps. |
| 19:26 | jhawk28 | misstype, it should disable an EvalReader |
| 19:31 | hiredman | jhawk28: I think you would set the flag before you call the reader |
| 19:31 | jhawk28 | the issue is of scope |
| 19:31 | jhawk28 | for exampler: |
| 19:31 | hiredman | (binding [*read-eval* false] (read untrusted-data)) |
| 19:32 | jhawk28 | (binding [*read-eval* false] #=(def x 3)) |
| 19:33 | jhawk28 | the when the #= is read, it does not have visibility of the false value of *read-eval* |
| 19:34 | jhawk28 | pardon my grammar :) |
| 19:37 | jhawk28 | here is an actual functional example: (binding [*read-eval* false] ) #=(eval (def x 3)) |
| 19:39 | Mec | if you're expecting a list you can destruct it like (first & rest) right? |
| 19:40 | ayrnieu | jhawk, 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:41 | ayrnieu | jhawk - 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:42 | jhawk28 | agreed, it is madness :) |
| 19:42 | ayrnieu | ,((fn [(a & b)] a) [1 2 3]) |
| 19:42 | clojurebot | java.lang.RuntimeException: java.lang.RuntimeException: java.lang.Exception: Unsupported binding form: (a & b) |
| 19:43 | ayrnieu | ,((fn [[a & b]] a) '(1 2 3)) |
| 19:43 | clojurebot | 1 |
| 19:43 | Mec | ,((fn [[a & b]] b) '(1 2 3)) |
| 19:43 | clojurebot | (2 3) |
| 19:44 | Mec | ah excellent |
| 19:58 | jhawk28 | :ayrnieu looking into it |
| 20:06 | cooldude127 | why didn't anyone tell me about eclim? eclipse + vim = java love |
| 20:17 | Drakeson | (require 'java.net.URLConnection |
| 20:17 | Drakeson | oops! |
| 20:19 | Drakeson | how can I access URLConnection? (require 'java.net.URLConnection) is apparently not the right way. |
| 20:19 | durka42 | (import '[java.net URLConnection]) |
| 20:20 | Drakeson | what is the first part (java.net) called in java terminology? the the whole thing (java.net.URLConnection) is a "java class". |
| 20:21 | durka42 | not entirely sure |
| 20:21 | durka42 | i would call java.net.URLConnection a "fully qualified class name" |
| 20:27 | Drakeson | well, even (import '[java.net URLConnection]) is not working :( |
| 20:28 | Drakeson | I have sun-java6-jdk, sun-java6-jre, sun-java6-bin |
| 20:28 | Drakeson | can you confirm whether it is working for you? |
| 20:29 | Drakeson | oops, nevermind |
| 20:29 | Drakeson | thanks a lot |
| 20:29 | Drakeson | it was all a very stupid mistake. |
| 21:03 | durka42 | i can't find where vimclojure does C-w = but it's really annoying |
| 21:03 | cooldude127 | durka42: i agree. i like my repl smaller |
| 21:10 | cooldude127 | is it just the vimclojure prompt that doesn't show the current namespace? or is that just what the vanilla clojure repl does? |
| 21:12 | durka42 | cooldude127: :set noequalalways |
| 21:12 | durka42 | stops the flickering too |
| 21:12 | cooldude127 | durka42: that's for the repl problem? |
| 21:12 | cooldude127 | cool |
| 21:12 | durka42 | yeah |
| 21:13 | durka42 | yeah, it doesn't show the namespace |
| 21:13 | durka42 | gorilla makes its own prompt |
| 21:13 | cooldude127 | that's lame, i like seeing the namespace |
| 21:13 | durka42 | i bet it wouldn't be too hard to hack in |
| 21:14 | cooldude127 | it would for me. i'm just starting with vim |
| 21:14 | durka42 | well, me too |
| 21:14 | durka42 | i meant for someone who knew vimscript :) |
| 21:14 | cooldude127 | lol |
| 21:14 | durka42 | vimclojure does keep track of the current namespace, though |
| 21:15 | cooldude127 | like in the file? |
| 21:15 | durka42 | wait, that might be different |
| 21:15 | cooldude127 | idk, what are you talking about? |
| 21:15 | durka42 | there'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:16 | cooldude127 | well that's kinda important for the eval commands, so they end up in the right ns |
| 21:25 | cooldude127 | durka42: :set noequalalways didn't totally fix it. it still readjusted, it's just not equal |
| 21:25 | cooldude127 | i think it had something to do with the preview window opening |
| 21:28 | durka42 | hmm, fixed it for me. the preview window opens and closes on \p but the repl stays |
| 21:28 | durka42 | maybe it has something to do with the settings i was fiddling with before |
| 21:28 | cooldude127 | could be |
| 21:31 | Drakeson | how do you inspect the constructor of a class in slime? |
| 21:31 | Drakeson | C-c I does not show me anything about the ctor |
| 21:32 | Drakeson | (I have the most recent slime) |
| 21:33 | Drakeson | also, are there examples showing how to port some java code to clojure? |
| 21:34 | duncanm | Drakeson: is there a set way to do it? |
| 21:34 | duncanm | Drakeson: my understanding is that one doesn't write OO-style code in Clojure much |
| 21:35 | cooldude127 | yeah you don't usually |
| 21:35 | cooldude127 | functional code is what clojure's about |
| 21:35 | duncanm | i've been writing clojure for two weeks now, and only last night did i learn about gen-class |
| 21:36 | Chouser | duncanm: and now you're trying to un-learn it, aren't you. |
| 21:36 | duncanm | heh |
| 21:36 | duncanm | proxy is okay |
| 21:36 | cooldude127 | genclass it usually unnecessary |
| 21:36 | Chouser | yes, proxy is much better, except when it's insufficient. |
| 21:39 | cooldude127 | durka42: do you have anything like paredit for emacs in vim? |
| 21:39 | durka42 | there is surround.vim |
| 21:39 | durka42 | things like (cursor on open paren) ys%) to surround the form with parens |
| 21:40 | durka42 | autoclose.vim does what it says but gets annoying sometimes |
| 21:41 | cooldude127 | :( i love paredit |
| 21:43 | Raynes | cooldude127: Use emacs. |
| 21:44 | cooldude127 | i'm using vim to see what i'm missing |
| 21:44 | Chouser | cooldude127: wow |
| 21:44 | dnolen | cooldude127: that's a new one ;) emacs missing something? no... |
| 21:45 | cooldude127 | not necessarily in features |
| 21:45 | cooldude127 | but in the way it works |
| 21:45 | Chouser | I mean, I'm a habitual vim user, but I certainly have a bit of an inferiority complex. |
| 21:45 | duncanm | cooldude127: you like having modes? |
| 21:45 | Chouser | emacs has modes |
| 21:45 | cooldude127 | not the same kind of modes |
| 21:45 | Raynes | cooldude127: You're missing nothing. |
| 21:46 | cooldude127 | duncanm: i'm not minding it so far |
| 21:46 | Chouser | sure, it has the mode you're in immediately after pressing Meta-Something |
| 21:46 | Chouser | but before you press something else |
| 21:46 | cooldude127 | oh well i guess so |
| 21:46 | duncanm | cooldude127: other than that, i don't really see how it works differently |
| 21:46 | duncanm | huh? |
| 21:46 | powr-toc | Emacs also has viper-mode for vi-like modes |
| 21:46 | duncanm | in emacs, there are commands and buffers, that's it |
| 21:47 | duncanm | M-x just opens a new buffer and put the point there |
| 21:48 | Chouser | ctrl-w n does the same in vim |
| 21:48 | duncanm | Chouser: not when you're in insert mode |
| 21:49 | Raynes | "Insert mode" is one of the things I dislike about Vim. |
| 21:49 | cooldude127 | so far i'm liking vim, i'm just trying to get used to it |
| 21:49 | duncanm | Raynes: if you remove that, vim wouldn't be vim |
| 21:49 | Chouser | it's what I like most about vim, and would seek to emulate in emacs if/when I switch. |
| 21:49 | Raynes | One more for commands and another for inserting is annowing. |
| 21:50 | Raynes | annoying* |
| 21:50 | cooldude127 | i love the eclim (eclipse + vim) plugin so much |
| 21:50 | dnolen | personally 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:50 | durka42 | cooldude127: are you using vimclojure along with eclim? |
| 21:51 | Raynes | I only use Emacs for Haskell. |
| 21:51 | Chouser | cooldude127: I may have to try that. I've previously tried jvi + enclojure + netbeans. |
| 21:51 | durka42 | cooldude127: and what parts of eclim are awesome? |
| 21:52 | cooldude127 | durka42: it uses eclipse project management, and gives you java formatting, validation, and refactoring |
| 21:52 | cooldude127 | takes care of ant support too |
| 21:52 | cooldude127 | so it runs ant from the right directory |
| 21:52 | durka42 | that helps |
| 21:52 | cooldude127 | it takes all the good stuff from eclipse, and leaves out the suck, replacing it with vim |
| 21:54 | cooldude127 | i can't stand editing java in eclipse, it's just unbearable. |
| 21:55 | cooldude127 | navigation is such a pain |
| 21:55 | cooldude127 | </rant> |
| 21:57 | jhawk28 | just have to figure out the shortcuts |
| 21:58 | jhawk28 | the problem with eclipse shortcuts is they can sometimes be very long |
| 22:00 | cooldude127 | not fun. not fun at all |
| 22:00 | cooldude127 | i used to be able to do it until i got used to emacs, and stopped using arrow keys |
| 22:01 | jhawk28 | I want to get used to Emacs, but I can't remember the shortcuts |
| 22:02 | dnolen | jhawk28: http://users.ece.utexas.edu/~adnan/emacs-refcard.pdf |
| 22:04 | jhawk28 | dnolen: thanks |
| 22:04 | dnolen | np |
| 22:05 | cooldude127 | durka42: you use the shortcuts in the repl to go through the history? |
| 22:06 | durka42 | yes, C-up and C-down |
| 22:06 | durka42 | i remapped them to M-up and M-down because i have spaces on the control key |
| 22:06 | cooldude127 | durka42: me too! |
| 22:06 | cooldude127 | what were the commands you did? |
| 22:07 | durka42 | in your vimrc |
| 22:07 | durka42 | autocmd FileType * if &ft == "clojure" | imap <M-up> <Plug>ClojureReplUpHistory| endif |
| 22:07 | durka42 | and the same for M-down and ClojureReplDownHistory |
| 22:08 | durka42 | the above is magic -- kotarak arrived at it after much experimentation and i am not sure how it works |
| 22:10 | Mec | can you put a recur and the end of an and? |
| 22:11 | Chouser | Mec: I would thinks so. |
| 22:11 | cmvkk | and is just a macro on top of if probably |
| 22:12 | Chouser | ,(loop [i 5] (and (pos? i) (recur (dec i)))) |
| 22:12 | clojurebot | false |
| 22:12 | Mec | excellent, shouldn't matter if it's a loop or function right? |
| 22:13 | cooldude127 | durka42: thanks |
| 22:14 | cmvkk | shouldn't matter. |
| 22:15 | cmvkk | hmm...using 'or' that way might be a concise way to return a value at the end of a loop |
| 22:16 | Chouser | Mec: right. |
| 22:16 | Mec | you'd need a pred that returns false or the value tho if i understand what your thinking |
| 22:17 | cmvkk | yeah, the value or nil more likely. |
| 22:17 | cmvkk | i can't even think of a useful example off the top of my head though |
| 22:17 | Mec | ya its basically just a while nil do sort of thing |
| 22:19 | cmvkk | ,(loop [a '(nil nil 1 2 3)] (or (first a) (recur (next a)))) |
| 22:19 | clojurebot | 1 |
| 22:19 | cmvkk | gets the first non-nil value. |
| 22:19 | cmvkk | that's the best i can do. |
| 22:19 | Mec | yup thats what came to my mind, doesnt seem too useful |
| 22:29 | jhawk28_ | what is the command to exit out of the repl? |
| 22:29 | durka42 | emacs or vim? |
| 22:29 | catch23 | does the Repl support a command-line option to pass in code directly as a string? |
| 22:29 | duncanm | control-d? |
| 22:30 | duncanm | oh |
| 22:30 | jhawk28_ | there is no function or macro like exit or quit? |
| 22:30 | catch23 | jhawk28_: can always do the java exit :) |
| 22:31 | duncanm | Runtime/exit |
| 22:31 | cooldude127 | System/exit |
| 22:31 | durka42 | ,close |
| 22:31 | clojurebot | java.lang.Exception: Unable to resolve symbol: close in this context |
| 22:32 | duncanm | user=> (.exit (Runtime/getRuntime) 0) |
| 22:34 | jhawk28_ | I thought I was missing something |
| 22:43 | Mec | is there a way to get all the repl inputs and save them to a file? |
| 22:45 | cooldude127 | Mec: use a good text editor |
| 22:45 | Mec | in emacs? |
| 22:45 | cooldude127 | Mec: you could save the slime repl buffer to a file and then do some postprocessing to filter the lines |
| 22:46 | Mec | ah ok |
| 22:46 | durka42 | grep "^Clojure=>" |
| 22:47 | durka42 | well unless it shows namespaces |
| 22:47 | cooldude127 | durka42: slime buffer does |
| 22:50 | duncanm | slime doesn't support clojure debugging the same it does for CL, is that right? |
| 22:59 | Mec | is there a function: (f * 5 (range 1 10)) -> (5 10 15 20 25 ...) |
| 22:59 | hiredman | reductions, I think it is somewhere in contrib |
| 22:59 | durka42 | ,(map (* 5 %) (range 1 10)) |
| 22:59 | Mec | i suppose i could (repeat 5) |
| 22:59 | clojurebot | arg literal not in #() |
| 22:59 | durka42 | ,(map #(* 5 %) (range 1 10)) |
| 22:59 | clojurebot | (5 10 15 20 25 30 35 40 45) |
| 23:00 | durka42 | heh, i'm writing python and i just thought "this needs to be in a transaction" |
| 23:00 | Chouser | nice |
| 23:01 | hiredman | I have been writing php all this afternoon |
| 23:01 | durka42 | yuck |
| 23:02 | hiredman | I have been writing a parser for a lisp with similar syntax to clojure |
| 23:02 | cp2 | ...in php? |
| 23:02 | gnuvince_ | What does it mean "to chug"? |
| 23:02 | Chouser | gnuvince_: depends on context |
| 23:03 | durka42 | ...as in a beverage? |
| 23:03 | hiredman | cp2: the idea being I can use this lisp in place of php |
| 23:03 | cp2 | oh |
| 23:03 | cp2 | then by all means |
| 23:03 | cp2 | :) |
| 23:03 | gnuvince_ | Can it mean "to move/displace/transport" something? |
| 23:04 | gnuvince_ | Or am I confusing with another verb? |
| 23:04 | Mec | there has to be a better way, this is kind of uggly: |
| 23:04 | Mec | ,(mapcat (fn [n] (map #(* % n) (range 1 5))) (range 1 5)) |
| 23:04 | clojurebot | (1 2 3 4 2 4 6 8 3 6 9 12 4 8 12 16) |
| 23:04 | gnuvince_ | Mec: for? |
| 23:04 | gnuvince_ | ,(for [x (range 1 5) y (range 1 5)] (* x y)) |
| 23:04 | clojurebot | (1 2 3 4 2 4 6 8 3 6 9 12 4 8 12 16) |
| 23:05 | Mec | hey now, thats perfect |
| 23:05 | gnuvince_ | :) |
| 23:05 | Chouser | gnuvince_: a train might "chug", but that's the closest to transport I can think of. |
| 23:05 | hiredman | ,(user 'clojure.contrib.seq_utils.clj) |
| 23:05 | clojurebot | java.lang.Exception: Unable to resolve symbol: user in this context |
| 23:05 | hiredman | ,(use 'clojure.contrib.seq_utils.clj) |
| 23:05 | clojurebot | java.io.FileNotFoundException: Could not locate clojure/contrib/seq_utils/clj__init.class or clojure/contrib/seq_utils/clj.clj on classpath: |
| 23:05 | hiredman | hmmm |
| 23:05 | gnuvince_ | Okay, then it's not the word I'm looking for |
| 23:05 | cp2 | i guess if something chugs along it could be with...great momentum ? |
| 23:05 | cmvkk | you can use it metaphorically...to chug along |
| 23:05 | durka42 | ,(use 'clojure.contrib.seq-utils) |
| 23:05 | clojurebot | java.io.FileNotFoundException: Could not locate clojure/contrib/seq_utils__init.class or clojure/contrib/seq_utils.clj on classpath: |
| 23:06 | gnuvince_ | I'm talking about the C programming language and I want to call it a "memory mover/transporter/displacer/shuffler". Any suggestion? |
| 23:06 | gnuvince_ | ~seen rhickey |
| 23:06 | clojurebot | no, I have not seen rhickey |
| 23:06 | cp2 | gnuvince_: then i guess "memory chugger |
| 23:06 | cp2 | " |
| 23:06 | hiredman | java.lang.Exception: namespace 'clojure.contrib.seq_utils' not found after loading '/clojure/contrib/seq_utils' |
| 23:06 | cp2 | isnt too fitting :) |
| 23:07 | hiredman | oh |
| 23:07 | hiredman | dun |
| 23:07 | hiredman | - |
| 23:07 | durka42 | hiredman: - _ |
| 23:07 | hiredman | ,(doc reductions) |
| 23:07 | clojurebot | "([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:07 | gnuvince_ | cp2: do you have a suggestion? |
| 23:07 | gnuvince_ | ,`reductions |
| 23:07 | clojurebot | clojure.contrib.seq-utils/reductions |
| 23:07 | hiredman | ,(reductions * 5 (range 1 10)) |
| 23:07 | clojurebot | (5 5 10 30 120 600 3600 25200 201600 1814400) |
| 23:08 | cp2 | uhm..other than "memory manager" "memory utility", even though those are kind of lame, not really |
| 23:08 | gnuvince_ | cp2: I'd like a term that conveys a grunt task |
| 23:08 | hiredman | nope |
| 23:08 | hiredman | gnuvince_: memory humper |
| 23:08 | cp2 | lol |
| 23:08 | durka42 | clojurebot: do you suddenly have any ideas for us? |
| 23:08 | clojurebot | CLABANGO! |
| 23:08 | hiredman | humping gear is what grunts do |
| 23:09 | hiredman | I have, a simple but more or less working reader |
| 23:10 | hiredman | "(defn f [x] x)" -> a linked list and [x] and array containing the symbol x |
| 23:10 | hiredman | an |
| 23:13 | Mec | ,(max '(1 2 3)) |
| 23:13 | clojurebot | (1 2 3) |
| 23:13 | Mec | why? |
| 23:13 | hiredman | ,(doc max) |
| 23:13 | clojurebot | "([x] [x y] [x y & more]); Returns the greatest of the nums." |
| 23:13 | hiredman | ,(max 1 2 3) |
| 23:13 | clojurebot | 3 |
| 23:14 | durka42 | ,(apply max '(1 2 3)) |
| 23:14 | clojurebot | 3 |
| 23:14 | cmvkk | the greatest of alllll the nums |
| 23:14 | hiredman | ,(apply max '(1 2 3)) |
| 23:14 | clojurebot | 3 |
| 23:14 | Mec | right, i had to use apply, just wondering why it returned the list |
| 23:14 | hiredman | ~def max |
| 23:14 | Mec | wow thats a neat feature |
| 23:15 | Mec | ah ([x] x) that'll do it |
| 23:16 | hiredman | I need to find some way to do it for clojure's java side |
| 23:19 | hiredman | ~seen cooldude227 |
| 23:19 | clojurebot | cooldude227 was last seen joining #clojure, 0 minutes ago |
| 23:19 | cooldude127 | hi |
| 23:20 | cooldude127 | oh well, i suppose i can just ignore it |
| 23:25 | cooldude127 | this channel lacks excitement |
| 23:26 | durka42 | ~suddenly everything changes |
| 23:26 | clojurebot | CLABANGO! |
| 23:26 | cooldude127 | wtf just happened |
| 23:26 | durka42 | uh oh |
| 23:26 | durka42 | cooldude127 might need to read some logs |
| 23:27 | cooldude127 | durka42 might need to explain to cooldude127 what he's missing |
| 23:27 | cooldude127 | :-p |
| 23:28 | cmvkk | for all you guys have been throwing that word around, i haven't seen any actual software... |
| 23:28 | durka42 | well 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:28 | durka42 | which turned into a debate over the name |
| 23:28 | cooldude127 | hmmm...and the name is clabanga? |
| 23:28 | cooldude127 | *clabango |
| 23:28 | durka42 | and then we trained clojurebot to complete our jokes for us |
| 23:28 | cooldude127 | lol |
| 23:29 | durka42 | well, danlarkin is in favor of "madison" |
| 23:29 | Chouser | ~It wasn't making any sense, and then suddenly... |
| 23:29 | clojurebot | CLABANGO! |
| 23:29 | cooldude127 | haha |
| 23:31 | cmvkk | so there isn't actually going to be a famous piece of software called "Madison Square Clabango" in full? I find that vaguely disappointing... |
| 23:31 | cooldude127 | oh that would be hilarious |
| 23:31 | cmvkk | and it's such a catchy and unforgettable name. |
| 23:31 | cooldude127 | mhm |
| 23:32 | cooldude127 | random question: anyone in here using irssi? |
| 23:32 | cmvkk | I am...but i don't really know anything about it |
| 23:32 | replaca | cooldude127: me too |
| 23:32 | cooldude127 | me neither, i just installed it tonight |
| 23:32 | cooldude127 | i rather like it actually, tho i believe it has much more power than i'm aware of |
| 23:33 | hiredman | I am as well |
| 23:33 | replaca | cooldude127: Here is my link page, with just a few things: http://delicious.com/tomfaulhaber/irssi |
| 23:34 | replaca | I learned a bunch, but instantly forgot it |
| 23:34 | cooldude127 | cool stuff |
| 23:36 | jhawk28_ | I used to use irssi until I got Linkinus |
| 23:36 | cooldude127 | replaca: actually that top link helped fix a problem i was having with iterm |
| 23:40 | hiredman | ugh |
| 23:40 | hiredman | php's object system is so horrible |
| 23:40 | Raynes | Abusing trampoline is fun. |
| 23:42 | Mec | any thoughts on simplifying: (apply and (for [x (range 1 21)] (divisible 200 x))) |
| 23:42 | cooldude127 | Mec: the fact that it won't work |
| 23:42 | cooldude127 | and is a macro, which you can't apply |
| 23:43 | Mec | well then |
| 23:43 | Mec | any way to do that then ;p |
| 23:43 | replaca | cooldude127: great, glad to help |
| 23:43 | gnuvince_ | ,(all #(zero (rem 200 %)) (range 1 21)) |
| 23:43 | clojurebot | java.lang.Exception: Unable to resolve symbol: all in this context |
| 23:43 | gnuvince_ | ,(all? #(zero (rem 200 %)) (range 1 21)) |
| 23:43 | clojurebot | java.lang.Exception: Unable to resolve symbol: all? in this context |
| 23:43 | gnuvince_ | ,(every? #(zero (rem 200 %)) (range 1 21)) |
| 23:43 | clojurebot | java.lang.Exception: Unable to resolve symbol: zero in this context |
| 23:43 | gnuvince_ | ,(every? #(zero? (rem 200 %)) (range 1 21)) |
| 23:43 | clojurebot | false |
| 23:43 | cooldude127 | ,every |
| 23:43 | clojurebot | java.lang.Exception: Unable to resolve symbol: every in this context |
| 23:43 | cooldude127 | oh |
| 23:43 | gnuvince_ | can you believe I sometimes use this language? ;) |
| 23:43 | cooldude127 | lol |
| 23:44 | gnuvince_ | Mec: that looks like a Euler problem, isn't it? |
| 23:44 | Mec | indeed |
| 23:44 | gnuvince_ | finding the first integer that's evenly divisible by 1 to 20? |
| 23:44 | Mec | im working thru the problem set as a way to learn clojure |
| 23:44 | cooldude127 | nobody does code like that for real stuff |
| 23:44 | gnuvince_ | Mec: look into clojure.contrib.math/lcm instead |
| 23:45 | gnuvince_ | You'll get an answer much more quickly |
| 23:45 | Mec | sure but that's cheating ;p |
| 23:45 | hiredman | oh man |
| 23:45 | cooldude127 | Mec: nothing's cheating |
| 23:45 | cooldude127 | just get an answer :) |
| 23:45 | hiredman | this is too perfect, if only I can figure out how to use it |
| 23:45 | Mec | calling least common multiple is too easy |
| 23:45 | cooldude127 | hiredman: share :) |
| 23:45 | cooldude127 | Mec: well, yes this is true |
| 23:45 | gnuvince_ | Mec: that's the "correct" answer |
| 23:46 | gnuvince_ | ,(reduce clojure.contrib.math/lcm (range 1 21)) |
| 23:46 | clojurebot | java.lang.ClassNotFoundException: clojure.contrib.math |
| 23:46 | hiredman | cooldude127: php objects have a magic __invoke method that gets called if you try to use them as a function |
| 23:46 | cooldude127 | clojurebot doesn't have contrib |
| 23:46 | cooldude127 | hiredman: they do!? |
| 23:46 | gnuvince_ | ah |
| 23:46 | cooldude127 | hiredman: i don't remember that. i remember some of the other magic methods but not that one |
| 23:46 | Mec | i dont have contrib either, so that solves that problem ;p |
| 23:47 | hiredman | so when I figure out how I am going to store functions I can just use that |
| 23:47 | durka42 | that sounds rather useful actually |
| 23:47 | cooldude127 | Mec: you should probably get contrib |
| 23:47 | cooldude127 | life's easier that way |
| 23:47 | cooldude127 | less wheel reinventing |
| 23:47 | hiredman | IFns have about 20 invoke methods |
| 23:48 | cooldude127 | wow |
| 23:48 | cooldude127 | trying to prolong a varargs one? |
| 23:49 | hiredman | ,(count (filter #(= % "invoke") (map #(.getName %) (.getMethods clojure.lang.IFn)))) |
| 23:49 | clojurebot | 22 |
| 23:49 | hiredman | Yeah |
| 23:50 | durka42 | the JVM crashed on me >:o |
| 23:50 | hiredman | it happens |
| 23:51 | durka42 | i called source after rebuilding clojure |
| 23:52 | durka42 | so i assume it cached a file descriptor or something |
| 23:52 | durka42 | that no longer existed |