#clojure log - May 31 2008

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

14:53 Lau_of_DK: Evening

14:53 jgracin: hi!

14:54 Lau_of_DK: I'm in the process of transitioning from SBCL -> Clojure. Is somewhere here willing to give a few pointers on the subtle differences in emacs? :)

14:54 jgracin: you mean in using SLIME?

14:55 Lau_of_DK: No, its basically some of the changes in how the hot-keys work. I have a REPL loop running, and then in a seperate frame I have my sourcefile, which works with indentation and all that. But in SBCL I could press F8 to compile my entire file, and then execute the needed functions in the REPL - How do I do that in Clojure ?

14:57 jgracin: have you installed clojure-mode for Emacs?

14:57 Lau_of_DK: yes, I installed the advanced one

14:57 (brb)

15:01 jgracin: I don't know if there's a default key binding for "evaluate-buffer" in clojure-mode. I haven't found it. But the Clojure menu contains "Evaluate region". That's what I use.

15:02 I haven't started writing any serious code in Clojure yet, so I didn't bother to setup all the key-bindings.

15:03 Chouser: yeah, I'm still concentrating on humorous code.

15:06 jgracin: Clojure really raised my hopes of ever using Lisp in my daytime job. Common Lisp is a bit of a tough sell in that regard.

15:06 Not only because of JVM...

15:08 drewr: C-c C-k.

15:09 Compile buffer... just like CL.

15:09 jgracin: drewr: nope. Not in my Emacs.

15:10 drewr: Hm.

15:10 jgracin: using clojure-mode by J.Chu

15:10 drewr: It works for me. Do you have an inferior-lisp hooked up to the buffer?

15:10 jgracin: yes

15:10 drewr: The status bar should read "(Clojure Slime ...)".

15:11 jgracin: oh, there we are. I'm not using Slime with Clojure.

15:11 drewr: Look into the swank-clojure goodness.

15:12 jgracin: What's the state of Clojure Swank?

15:13 Lau_of_DK: back

15:13 Lemme try CompileRegion and C-c C-k

15:14 jgracin: Lau_of_DK: I haven't given Clojure Swank a chance, and it seems I should have. Off to install it...

15:14 Lau_of_DK: Hehe, lemme know how it goes

15:15 Compile Region seems to work well enough

15:15 drewr: It works great. Not quite as full-featured as CL, but makes dev a lot more fun.

15:15 Lau_of_DK: define fun?

15:16 jgracin: I used to hang out in SLIME on SBCL quite a lot...

15:16 drewr: Lau_of_DK: The kind of interaction you have between a buffer and the REPL, same as SBCL.

15:17 You can't introspect objects yet though. Not sure how that would work, but I guess it's possible.

15:17 Lau_of_DK: k

15:21 Do all of you guys use the Emacs/Slime/Clojure setup ?

15:26 drewr, Could you please tell me exactly how you mimic the SBCL/Repl setup with Clojure - As is, I cant get them to interact. I start Emacs, split buffers (C-x 2), in one I do M-x run-lisp, in the other I load my .clj file.

15:46 ok, maybe not drewr ... anybody? :)

15:47 jgracin: Lau_of_DK: I'm trying to setup slime with clojure at the moment. I hope I make it work soon.

15:49 when I start slime, clojure throws exception about progn not being defined. Slime tries to eval a block of CL code in Clojure.

16:01 drewr: Lau_of_DK: First start SLIME with M-- M-x slime RET.

16:02 The instructions are in the comments of the elisp files.

16:05 jgracin: drewr: should variable slime-lisp-implementations contain full path to the script that starts clojure JVM? I have set it to '((clojure "/home/gracin/software/clojure.sh")) where clojure.sh is my script which starts Clojure REPL.

16:06 i.e. '((clojure ("...")))

16:12 Lau_of_DK: it needs to be full path to the clojure.jar file

16:12 everything else (which is only java?) should be on your path

16:13 drewr: Sorry, the swank-clojure.clj has the instructions.

16:13 Lau_of_DK: oh this is weird. If I start emacs and (M-x run-lisp) then I get a working REPL - but if I M-x slime, then it gives me the same error that jgracin got

16:13 drewr: Lau_of_DK: M-- M-x slime RET clojure RET

16:13 The prefix arg is significant.

16:14 Lau_of_DK: What is M-- ?

16:14 jgracin: Lau_of_DK: run-lisp starts inferior-lisp, AFAIK, it does not start slime.

16:14 Lau_of_DK: true

16:14 drewr: M-- is meta-dash.

16:15 M-- runs the command negative-argument.

16:16 jgracin: drewr: when you start slime, what's in the first line of inferior-lisp buffer? I get a Common Lisp expr (progn (load "...")...) which cannot be evaluated in Clojure.

16:16 drewr: You're still running CL.

16:16 swank-clojure.clj should be executed.

16:17 jgracin: should I copy that file to Slime install dir_

16:17 ?

16:17 Do I have to patch slime installation?

16:17 Lau_of_DK: drewr, can you give me the exact keystrokes for M-- M-x slime RET clojure RET ? I tried M-x slime<return>, which gives me the progn error that jgracin got, then M-x clojure, which doesnt exist, only had clojure-mode

16:19 drewr: Lau_of_DK: Type the ALT key, hold it down, then hit the minus key.

16:19 The do M-x slime RET et.c

16:20 Lau_of_DK: Ah ok - new trick :)

16:20 Alt + (-) + M-x slime RET => then it promps "Lisp name:" then I typed Clojure, and it says "no match"

16:21 drewr: OK, that's progress.

16:21 Lau_of_DK: :)

16:21 drewr: brb

16:21 Lau_of_DK: I also dont have the swank-clojure.clj file you mentioned.

16:22 I installed the advanced-emacs thing, which is .el files I think, and then I unzipped the Clojure stuff, which was the .jar ile, and some sources

16:23 drewr, you cant just go man, your my lifeline :)

16:24 jgracin: Lau_of_DK: you have to get it via git from http://clojure.codestuffs.com/

16:24 Lau_of_DK: and where is this "advanced-emacs"?

16:24 Lau_of_DK: hang on

16:24 http://clojure.codestuffs.com/pub/clojure-emacs.git/

16:25 You can get it from here

16:25 wait

16:25 its moved :)

16:25 git clone git://github.com/jochu/clojure-mode.git

16:25 do that

16:25 drewr: There's also swank-clojure. Separate project.

16:25 Git that too.

16:27 Lau_of_DK: argh :)

16:27 I think that link I gave you, that has settings you need to integrate into your .emacs

16:27 drewr: Once you git it, read the comments in swank-clojure.clj.

16:27 Lau_of_DK: I'm on it

16:28 But let me just get this straight. Swank is the REPL server, and swank-clojure modifies it to evaluate clojure-code then ?

16:28 http://github.com/jochu/swank-clojure/tree/master <-- This the one you guys are using?

16:29 drewr: Swank is a protocol that lets you communicate with the REPL.

16:29 Jeffrey Chu wrote the clojure code to speak the protocol so you can use SLIME.

16:30 Lau_of_DK: What provides the server then ?

16:31 drewr: Clojure.

16:31 The REPL is still Repl.java underneath.

16:32 Lau_of_DK: ah ok.. thanks for clearing that up

16:32 I'm looking through the swank-clojure now

16:34 jgracin: Lau_of_DK: got it!

16:34 Lau_of_DK: you got it working? :)

16:34 jgracin: yup.

16:34 Lau_of_DK: alright, I'm right behind you ( I hope )

16:35 jgracin: (setq slime-lisp-implementations '((clojure ("/home/gracin/software/clojure/compiler/start.sh") :init clojure-init)))

16:35 the point was in :init clojure-init

16:37 Lau_of_DK: that goes anywhere in my .emacs ?

16:38 jgracin: I'll show you what I have in my .emacs that's related to slime/clojure....

16:39 Lau_of_DK: Did you get that bit about the sh script ? Their .git seems to be down for the extras

16:39 jgracin: You probably don't need it. Try without it first.

16:39 I didn't use it.

16:42 Lau_of_DK: argh, dont tell me that after I got it working :)

16:43 Gimme 5 minz, I think I'm on the right track

16:44 jgracin: Lau_of_DK: Here's the part of my .emacs file which has to do with SLIME and Clojure setup. http://www.inge-mark.hr/~gracin/myemacs

16:45 Lau_of_DK: Thanks alot

16:45 jgracin: np

16:48 Lau_of_DK: the start.sh that you execute, what is that?

16:49 also - its in /clojure/compiler/ - where did you get that lib from ?

16:55 come on jgracin , dont leave me hanging baby :)

17:02 jgracin: Lau_of_DK: sorry. start.sh is my script that contains ...

17:02 java -cp clojure.jar clojure.lang.Repl

17:02 make the script executable

17:03 Lau_of_DK: where did you get the lib /compiler/ from ? Made it yourself, or is it because youre using a different package than me?

17:03 jgracin: clojure/compiler is where I keep the Clojure sources

17:04 that's where I generated clojure.jar from Clojure sources

17:04 Lau_of_DK: oh, you compiled it yourself? It was in the package I downloaded

17:05 jgracin: yes, I compiled it myself. You can use whatever you've got. The point is that it must start Clojure REPL.

17:06 Lau_of_DK: sure, but this is weird. I added all your emacs stuff to the bottom of my .emacs file, and then I modified all the paths to fit my setup, start emacs. First if gives me some kind of error that it quickly hides. Then I hit M-- and then M-x slime RET - Then it says [no match] ...?

17:08 jgracin: Place the point over slime-lisp-implementations and press "C-h v" and enter to see what the value of that variable is.

17:10 My setup resets that variable so there are no other lisps. In that case, you can just use M-x slime RET, i.e. without M-- prefix argument for slime.

17:10 brb

17:11 Lau_of_DK: place the point over..? There's nothing but an empty sheet... And its weird before we started. Everything worked fine, SLIME, SBCL.. Now even M-x slime, fails, says no match

17:16 aha, the error that flashed was this: Symbol's value as variable is void: slime-lisp-implementations

17:19 jamii: Hi all. Is there a way to get the last evaluated expression in the REPL? It doesnt seem to be documented anywhere.

17:30 Lau_of_DK: If you get it running in emacs its ctrl+up

17:48 jgracin: Lau_of_DK: still there?

17:49 Lau_of_DK: jgracin, yea, didnt you get all my query messages?

17:49 jgracin: yeah, I did. Did you manage to set slime-lisp-implementations variable?

17:50 Lau_of_DK: I can tell you in a second

17:50 jgracin: Lau_of_DK: oops. sorry, I didn't see your private messages until now!

17:50 Lau_of_DK: I just got SBCL/Slime running again

17:50 jgracin: Let me read them.

17:50 Lau_of_DK: k

17:52 could you double check our emacs file on http://www.inge-mark.hr/~gracin/myemacs I think there might be something wrong in it

18:48 ericthor: rhickey: since we are talking about the fast math lib, it appears to take a bit of time to load the clojure.jar.

18:48 rhickey: poll: it looks like I can make the fast math primitives polymorphic, so no need for separate flot/+, int/+, BUT, since some are unsafe, I need to distinguish from +,-,*. I'm looking for a single prefic or very short namespace for the "fast" ops, something like !+, !-, !* !< etc?

18:50 ericthor: I have not isolated where the time is taking but, as you know, I'm using rather powerful boxes...it can be a bit frustrating when troubleshooting problems in a app....

18:51 Have you seen this on your end?

18:52 rhickey: a couple of secs, not something I would focus on

18:58 drewr: rhickey: I like the ! prefix.

18:59 rhickey: alternatively, Java primitives would default to fast:

18:59 user=> (+ (. Integer MAX_VALUE)(. Integer MAX_VALUE))

18:59 -2

18:59 unless coaxed to boxed:

18:59 user=> (+ (num (. Integer MAX_VALUE)) (. Integer MAX_VALUE))

18:59 4294967294

18:59 literals are already boxed

19:00 (+ 2147483647 2147483647)

19:00 4294967294

19:01 Lau_of_DK: I'm trying to compile clojure from the SVN, but mvn cannot find my java installation. Its located in /usr/lib/jvm/java-6-sun- - - What do I export my $JAVA_HOME to, to get this to work ?

19:01 rhickey: then just a single set of +/-/* etc

19:05 Lau_of_DK: keep sleeping, I fixed it

19:09 anybody still up ?

19:10 Look, I finally got Clojure to work in Emacs. But my joy was stopped instantly. Every time I press SPACE a buffer puffs up and say "Unable to resolve symbol: user" ...

19:10 How do I stop this madness? :)

19:14 anybody?

19:18 Look, I finally got Clojure to work in Emacs. But my joy was stopped instantly. Every time I press SPACE a buffer puffs up and say "Unable to resolve symbol: user" ...

19:23 ericthor: rich: yesterday I grabbed the latest clojure and removed all the object.invoke stuff. I'm getting an error in the topological sort function:

19:24 java.lang.NoSuchFieldError: EMPTY

19:24 at clojure.fns.depends.top_sort__4859.invoke(depends.clj:201)

19:24 at clojure.fns.depends.get_depends__4892.doInvoke(depends.clj:298)

19:25 there is no reference to the EMPTY instance that I can see in my clojure code. I'm going to try and step into the clojure code...see if i can see what is happening.

19:32 Lau_of_DK: Look, I finally got Clojure to work in Emacs. But my joy was stopped instantly. Every time I press SPACE a buffer puffs up and say "Unable to resolve symbol: user" ...

19:54 rhickey: eric: what is at depends.clj line 201?

21:47 SVN 887 is an interim checkin - DO NOT USE!

Logging service provided by n01se.net