#clojure logs

2008-06-01

04:05jochuAw, I was hoping to catch Lau of DK lounging about to let him know the swank clojure bug he hit was fixed. Ah well.
04:50jteois "do" documented anywhere?
05:11arbschtjteo: http://clojure.sourceforge.net/reference/special_forms.html
05:11jteoah. sorrie for my blindness. :)
06:42jacksmackI've recently set up Emacs as my Clojure IDE, and it starts fine, but there's one problem. Everytime I hit SPACE in the REPL, it spawns an error "Unable to resolve symbol: user in this context" - Anybody know whats up with that ?
06:45Lau_of_DKI've recently set up Emacs as my Clojure IDE, and it starts fine, but there's one problem. Everytime I hit SPACE in the REPL, it spawns an error "Unable to resolve symbol: user in this context" - Anybody know whats up with that ?
07:17Lau_of_DKcome on boys - anybody?
07:59Lau_of_DKI've recently set up Emacs as my Clojure IDE, and it starts fine, but there's one problem. Everytime I hit SPACE in the REPL, it spawns an error "Unable to resolve symbol: user in this context" - Anybody know whats up with that ?
08:14fezzlewhoa, no idea man. i'm trying to use enlojure
08:16Lau_of_DKI just feel like emacs is quicker for small things. But ok, do you have any small examples of how to get started with enclojure?
08:21Lau_of_DKfezzle, ?
08:22Lau_of_DKHey jgracin :)
08:22jgracinHi Lau_of_DK! How's Slime? :-)
08:22Lau_of_DKOh, so so :)
08:23Lau_of_DKAfter you hit the sack last night, I managed to compile the package using mvn, so thats all good
08:23jgracinthen everything must work perfectly. doesn't it? ;-)
08:23Lau_of_DKNow emacs connects to swank all fine, and it uses correct indentation and all that, so I can assume that advanced-clojure-mode is working. Secondly it does evaluate clojure code correctly, so I can write an run programs..
08:23Lau_of_DKbut... there's one little bug... :(
08:25jgracinwhat is it?
08:25Lau_of_DKwhen I'm in the REPL, and I type "user>(+ 2 2)", it evaluated to 4 like it should, but when I hit SPACE it pop an error everytime saying "unable to resolve symbol: user in this context"
08:25Lau_of_DKso (+<SPACE>2<SPACE>2) means 2 errors, which is PRETTY annoying
08:27jgracindo you type that "user>" part as well? or you just type (+ 2 2)?
08:27Lau_of_DKjust (+2 2), user is the default prompt, I havent touched it
08:28jgracinsorry for asking. :-)
08:28Lau_of_DKhehe
08:28Lau_of_DKLike I said, I'm fairly good with Lisp, its Emacs that I'm super-noob with :)
08:29jgracinstart by making sure you have the latest slime from CVS. And the latest swank-clojure.
08:29Lau_of_DKI know I have the lastest swank-clojure, but I can check the slime
08:30Lau_of_DKyea Im also running the latest slime
08:31Lau_of_DKbut normally when you press SPACE, you'd get a function description at the bottom right? I assume thats what you get?
08:31Lau_of_DK(brb, gotta take of the baby)
08:40jgracinbbl
08:41Lau_of_DKarg :(
14:33jgracinLau, the instructions for checking out the latest SLIME version are on its home page (downloads link).
15:22Lau_of_DKjgracin, yea thanks, I've updated Slime now but the error persists. Its somehow connected to the SLDB.
15:24Lau_of_DKYES
15:24Lau_of_DKIs finally got it working
15:25Lau_of_DKPraise God
15:26jgracinwhat did it?
15:27Lau_of_DKI just mailed the Googlegroup if youre a part of it. The wiki site has a script, which does everything except "run-lisp", so it connects through swank and all that, but it still hasnt executed that function
15:27Lau_of_DKso solution: M-x run-lisp
15:27Lau_of_DKAnyway jgracin, I never would have made it this far if it wasn't for all your help, so you get 25 stars in my book! :)
15:28jgracinno problem :-)
15:32Lau_of_DKAny emacs experts here? I have a binding for C-M-x which evalutes the function at the cursor - how do I changed this binding to C-c c ?
15:36dabdlau: get the bound function by C-h k which executes the describe key function
15:36dabdthen you type C-M-x and Emacs will show you the bounf f
15:37dabdbound function
15:37Lau_of_DK(slime-reevaluate-defvar)
15:37Lau_of_DKthats what M-C-x is
15:37Lau_of_DKdabd, Im fishing for the syntax for emacs, how do I then make the binding for C + 2x c. or C-c c ?
15:38dabdthen you associate the new binding with define-key
15:39Lau_of_DK(define-key slime-re-evaluate-defvar [C-c c] 'slime-re-evaluate-defvar)
15:39Lau_of_DKwould that work ?
15:39dabd(define-key <insert clojure mode map here> "C-c b" '<your function here>)
15:39Lau_of_DKclojure mode map?
15:42dabdtry this (define-key clojure-mode-map "C-c c" 'lisp-eval-defun)
15:47Lau_of_DKHmm, it says "C-c c" is undefined
15:47Lau_of_DKoh.. it recognized it as C-cSPACEc
15:47Lau_of_DK:)
15:48dabdLet me see
15:50dabdsorry it should be: (define-key clojure-mode-map "\C-cc" 'lisp-eval-defun)
15:51Lau_of_DKsweet, lemme try
15:52Lau_of_DKYes sir, its working - Thanks alot
15:52dabdyou can put that definition in your .emacs
15:52dabdno problem
15:53jgracinLau_of_DK: I really think you should do yourself a favor and at least skim (if not read) through the first 200 (PDF) pages of GNU Emacs Manual. Trades a lot of frustration for a lot of fun.
15:54Lau_of_DKjgracin, Ok, I'll try to get through it, but only because its you who's asking :)
15:54jgracin:-)
15:56jgracintrust me. It is very difficult to learn how to use Emacs by guessing and asking on chat. But reading that manual will give you a real boost.
15:58Lau_of_DKAlright, but first things first. I have to let off a few bullets in Clojure, if this is half as good as I think it is, its going to be my "home sweet home" in the land of languages :)
16:00jgracinThat's exactly how I feel about Clojure. A Lisp which is at the same time more clean and more practical/pragmatic then other Lisps.
16:01Lau_of_DKand more portable, and sports huge libraries and has immutable persistant datastructures - its really a dream come true
16:09Lau_of_DKbefore I hit the manual though - Is there anyway I can trade with insanely ugly font that emacs defaults to, to something like Bitstream Vera Sans ?
16:11rhickeyLau_of_DK: that's a bit off topic
16:11Lau_of_DKrhickey, sure, but since nobody else is busy debating something clojure related, I figured we had the time
16:12rhickeyactually it's a bit distracting
16:12Lau_of_DKk, sorry, I'll hit the manual :)
16:18jgracinwhy am I getting "No matching method: addURL" when I eval: (. DynamicClassLoader (addURL (new URL "something")))
16:21rhickeyit's an instance method, not static. Anything wrong with add-classpath ?
16:23jgracinsilly me. thanks.
16:23rhickeynp
16:24Lau_of_DKThe "Context Free Art" example from the Wiki wont run by itself and the comments state that some libraries need to be compiled independant - Is there an exact guide to where I can find these libs, how I compile/include them in the project anywhere?
16:29rhickeymath stuff shaping up:
16:29rhickeyThis Java:
16:29rhickey static public float[] vmul(float[] x, float[] ys){
16:29rhickey final float[] xs = x.clone();
16:29rhickey for(int i = 0; i < xs.length; i++)
16:29rhickey xs[i] *= ys[i];
16:29rhickey return xs;
16:29rhickey }
16:29rhickeythis Clojure:
16:29rhickey(defn amul [#^floats xs #^floats ys]
16:29rhickey (amap xs i ret
16:29rhickey (* (aget ret i) (aget ys i))))
16:29rhickeySame exact speed
16:30rhickeyThis Java:
16:30rhickey static public float vsum(float[] xs){
16:30rhickey float ret = 0;
16:30rhickey for(int i = 0; i < xs.length; i++)
16:30rhickey ret += xs[i];
16:30rhickey return ret;
16:30rhickey }
16:30rhickeyThis Clojure:
16:30rhickey(defn asum [#^floats xs]
16:30rhickey (areduce xs i ret (float 0)
16:30rhickey (+ ret (aget xs i))))
16:30rhickeysame exact speed
17:02albinorhickey: nice
17:03rhickeyit's built on a new ability of let-vars to hold primitives directly
17:57Lau_of_DKThe "Context Free Art" example from the Wiki wont run by itself and the comments state that some libraries need to be compiled independant - Is there an exact guide to where I can find these libs, how I compile/include them in the project anywhere?
17:57Lau_of_DK(asking as one who is using Java for the first time)
18:55rhickeynew primitives support is up
18:56rhickeytire-kickers welcome, lots of changes under the hood