2008-06-01
| 04:05 | jochu | Aw, 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:50 | jteo | is "do" documented anywhere? |
| 05:11 | arbscht | jteo: http://clojure.sourceforge.net/reference/special_forms.html |
| 05:11 | jteo | ah. sorrie for my blindness. :) |
| 06:42 | jacksmack | I'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:45 | Lau_of_DK | I'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:17 | Lau_of_DK | come on boys - anybody? |
| 07:59 | Lau_of_DK | I'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:14 | fezzle | whoa, no idea man. i'm trying to use enlojure |
| 08:16 | Lau_of_DK | I 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:21 | Lau_of_DK | fezzle, ? |
| 08:22 | Lau_of_DK | Hey jgracin :) |
| 08:22 | jgracin | Hi Lau_of_DK! How's Slime? :-) |
| 08:22 | Lau_of_DK | Oh, so so :) |
| 08:23 | Lau_of_DK | After you hit the sack last night, I managed to compile the package using mvn, so thats all good |
| 08:23 | jgracin | then everything must work perfectly. doesn't it? ;-) |
| 08:23 | Lau_of_DK | Now 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:23 | Lau_of_DK | but... there's one little bug... :( |
| 08:25 | jgracin | what is it? |
| 08:25 | Lau_of_DK | when 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:25 | Lau_of_DK | so (+<SPACE>2<SPACE>2) means 2 errors, which is PRETTY annoying |
| 08:27 | jgracin | do you type that "user>" part as well? or you just type (+ 2 2)? |
| 08:27 | Lau_of_DK | just (+2 2), user is the default prompt, I havent touched it |
| 08:28 | jgracin | sorry for asking. :-) |
| 08:28 | Lau_of_DK | hehe |
| 08:28 | Lau_of_DK | Like I said, I'm fairly good with Lisp, its Emacs that I'm super-noob with :) |
| 08:29 | jgracin | start by making sure you have the latest slime from CVS. And the latest swank-clojure. |
| 08:29 | Lau_of_DK | I know I have the lastest swank-clojure, but I can check the slime |
| 08:30 | Lau_of_DK | yea Im also running the latest slime |
| 08:31 | Lau_of_DK | but normally when you press SPACE, you'd get a function description at the bottom right? I assume thats what you get? |
| 08:31 | Lau_of_DK | (brb, gotta take of the baby) |
| 08:40 | jgracin | bbl |
| 08:41 | Lau_of_DK | arg :( |
| 14:33 | jgracin | Lau, the instructions for checking out the latest SLIME version are on its home page (downloads link). |
| 15:22 | Lau_of_DK | jgracin, yea thanks, I've updated Slime now but the error persists. Its somehow connected to the SLDB. |
| 15:24 | Lau_of_DK | YES |
| 15:24 | Lau_of_DK | Is finally got it working |
| 15:25 | Lau_of_DK | Praise God |
| 15:26 | jgracin | what did it? |
| 15:27 | Lau_of_DK | I 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:27 | Lau_of_DK | so solution: M-x run-lisp |
| 15:27 | Lau_of_DK | Anyway 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:28 | jgracin | no problem :-) |
| 15:32 | Lau_of_DK | Any 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:36 | dabd | lau: get the bound function by C-h k which executes the describe key function |
| 15:36 | dabd | then you type C-M-x and Emacs will show you the bounf f |
| 15:37 | dabd | bound function |
| 15:37 | Lau_of_DK | (slime-reevaluate-defvar) |
| 15:37 | Lau_of_DK | thats what M-C-x is |
| 15:37 | Lau_of_DK | dabd, Im fishing for the syntax for emacs, how do I then make the binding for C + 2x c. or C-c c ? |
| 15:38 | dabd | then you associate the new binding with define-key |
| 15:39 | Lau_of_DK | (define-key slime-re-evaluate-defvar [C-c c] 'slime-re-evaluate-defvar) |
| 15:39 | Lau_of_DK | would that work ? |
| 15:39 | dabd | (define-key <insert clojure mode map here> "C-c b" '<your function here>) |
| 15:39 | Lau_of_DK | clojure mode map? |
| 15:42 | dabd | try this (define-key clojure-mode-map "C-c c" 'lisp-eval-defun) |
| 15:47 | Lau_of_DK | Hmm, it says "C-c c" is undefined |
| 15:47 | Lau_of_DK | oh.. it recognized it as C-cSPACEc |
| 15:47 | Lau_of_DK | :) |
| 15:48 | dabd | Let me see |
| 15:50 | dabd | sorry it should be: (define-key clojure-mode-map "\C-cc" 'lisp-eval-defun) |
| 15:51 | Lau_of_DK | sweet, lemme try |
| 15:52 | Lau_of_DK | Yes sir, its working - Thanks alot |
| 15:52 | dabd | you can put that definition in your .emacs |
| 15:52 | dabd | no problem |
| 15:53 | jgracin | Lau_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:54 | Lau_of_DK | jgracin, Ok, I'll try to get through it, but only because its you who's asking :) |
| 15:54 | jgracin | :-) |
| 15:56 | jgracin | trust 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:58 | Lau_of_DK | Alright, 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:00 | jgracin | That'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:01 | Lau_of_DK | and more portable, and sports huge libraries and has immutable persistant datastructures - its really a dream come true |
| 16:09 | Lau_of_DK | before 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:11 | rhickey | Lau_of_DK: that's a bit off topic |
| 16:11 | Lau_of_DK | rhickey, sure, but since nobody else is busy debating something clojure related, I figured we had the time |
| 16:12 | rhickey | actually it's a bit distracting |
| 16:12 | Lau_of_DK | k, sorry, I'll hit the manual :) |
| 16:18 | jgracin | why am I getting "No matching method: addURL" when I eval: (. DynamicClassLoader (addURL (new URL "something"))) |
| 16:21 | rhickey | it's an instance method, not static. Anything wrong with add-classpath ? |
| 16:23 | jgracin | silly me. thanks. |
| 16:23 | rhickey | np |
| 16:24 | Lau_of_DK | The "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:29 | rhickey | math stuff shaping up: |
| 16:29 | rhickey | This Java: |
| 16:29 | rhickey | static public float[] vmul(float[] x, float[] ys){ |
| 16:29 | rhickey | final float[] xs = x.clone(); |
| 16:29 | rhickey | for(int i = 0; i < xs.length; i++) |
| 16:29 | rhickey | xs[i] *= ys[i]; |
| 16:29 | rhickey | return xs; |
| 16:29 | rhickey | } |
| 16:29 | rhickey | this Clojure: |
| 16:29 | rhickey | (defn amul [#^floats xs #^floats ys] |
| 16:29 | rhickey | (amap xs i ret |
| 16:29 | rhickey | (* (aget ret i) (aget ys i)))) |
| 16:29 | rhickey | Same exact speed |
| 16:30 | rhickey | This Java: |
| 16:30 | rhickey | static public float vsum(float[] xs){ |
| 16:30 | rhickey | float ret = 0; |
| 16:30 | rhickey | for(int i = 0; i < xs.length; i++) |
| 16:30 | rhickey | ret += xs[i]; |
| 16:30 | rhickey | return ret; |
| 16:30 | rhickey | } |
| 16:30 | rhickey | This Clojure: |
| 16:30 | rhickey | (defn asum [#^floats xs] |
| 16:30 | rhickey | (areduce xs i ret (float 0) |
| 16:30 | rhickey | (+ ret (aget xs i)))) |
| 16:30 | rhickey | same exact speed |
| 17:02 | albino | rhickey: nice |
| 17:03 | rhickey | it's built on a new ability of let-vars to hold primitives directly |
| 17:57 | Lau_of_DK | The "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:57 | Lau_of_DK | (asking as one who is using Java for the first time) |
| 18:55 | rhickey | new primitives support is up |
| 18:56 | rhickey | tire-kickers welcome, lots of changes under the hood |