#clojure logs

2008-05-31

14:53Lau_of_DKEvening
14:53jgracinhi!
14:54Lau_of_DKI'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:54jgracinyou mean in using SLIME?
14:55Lau_of_DKNo, 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:57jgracinhave you installed clojure-mode for Emacs?
14:57Lau_of_DKyes, I installed the advanced one
14:57Lau_of_DK(brb)
15:01jgracinI 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:02jgracinI haven't started writing any serious code in Clojure yet, so I didn't bother to setup all the key-bindings.
15:03Chouseryeah, I'm still concentrating on humorous code.
15:06jgracinClojure 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:06jgracinNot only because of JVM...
15:08drewrC-c C-k.
15:09drewrCompile buffer... just like CL.
15:09jgracindrewr: nope. Not in my Emacs.
15:10drewrHm.
15:10jgracinusing clojure-mode by J.Chu
15:10drewrIt works for me. Do you have an inferior-lisp hooked up to the buffer?
15:10jgracinyes
15:10drewrThe status bar should read "(Clojure Slime ...)".
15:11jgracinoh, there we are. I'm not using Slime with Clojure.
15:11drewrLook into the swank-clojure goodness.
15:12jgracinWhat's the state of Clojure Swank?
15:13Lau_of_DKback
15:13Lau_of_DKLemme try CompileRegion and C-c C-k
15:14jgracinLau_of_DK: I haven't given Clojure Swank a chance, and it seems I should have. Off to install it...
15:14Lau_of_DKHehe, lemme know how it goes
15:15Lau_of_DKCompile Region seems to work well enough
15:15drewrIt works great. Not quite as full-featured as CL, but makes dev a lot more fun.
15:15Lau_of_DKdefine fun?
15:16jgracinI used to hang out in SLIME on SBCL quite a lot...
15:16drewrLau_of_DK: The kind of interaction you have between a buffer and the REPL, same as SBCL.
15:17drewrYou can't introspect objects yet though. Not sure how that would work, but I guess it's possible.
15:17Lau_of_DKk
15:21Lau_of_DKDo all of you guys use the Emacs/Slime/Clojure setup ?
15:26Lau_of_DKdrewr, 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:46Lau_of_DKok, maybe not drewr ... anybody? :)
15:47jgracinLau_of_DK: I'm trying to setup slime with clojure at the moment. I hope I make it work soon.
15:49jgracinwhen I start slime, clojure throws exception about progn not being defined. Slime tries to eval a block of CL code in Clojure.
16:01drewrLau_of_DK: First start SLIME with M-- M-x slime RET.
16:02drewrThe instructions are in the comments of the elisp files.
16:05jgracindrewr: 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:06jgracini.e. '((clojure ("...")))
16:12Lau_of_DKit needs to be full path to the clojure.jar file
16:12Lau_of_DKeverything else (which is only java?) should be on your path
16:13drewrSorry, the swank-clojure.clj has the instructions.
16:13Lau_of_DKoh 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:13drewrLau_of_DK: M-- M-x slime RET clojure RET
16:13drewrThe prefix arg is significant.
16:14Lau_of_DKWhat is M-- ?
16:14jgracinLau_of_DK: run-lisp starts inferior-lisp, AFAIK, it does not start slime.
16:14Lau_of_DKtrue
16:14drewrM-- is meta-dash.
16:15drewrM-- runs the command negative-argument.
16:16jgracindrewr: 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:16drewrYou're still running CL.
16:16drewrswank-clojure.clj should be executed.
16:17jgracinshould I copy that file to Slime install dir_
16:17jgracin?
16:17jgracinDo I have to patch slime installation?
16:17Lau_of_DKdrewr, 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:19drewrLau_of_DK: Type the ALT key, hold it down, then hit the minus key.
16:19drewrThe do M-x slime RET et.c
16:20Lau_of_DKAh ok - new trick :)
16:20Lau_of_DKAlt + (-) + M-x slime RET => then it promps "Lisp name:" then I typed Clojure, and it says "no match"
16:21drewrOK, that's progress.
16:21Lau_of_DK:)
16:21drewrbrb
16:21Lau_of_DKI also dont have the swank-clojure.clj file you mentioned.
16:22Lau_of_DKI 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:23Lau_of_DKdrewr, you cant just go man, your my lifeline :)
16:24jgracinLau_of_DK: you have to get it via git from http://clojure.codestuffs.com/
16:24jgracinLau_of_DK: and where is this "advanced-emacs"?
16:24Lau_of_DKhang on
16:24Lau_of_DKhttp://clojure.codestuffs.com/pub/clojure-emacs.git/
16:25Lau_of_DKYou can get it from here
16:25Lau_of_DKwait
16:25Lau_of_DKits moved :)
16:25Lau_of_DKgit clone git://github.com/jochu/clojure-mode.git
16:25Lau_of_DKdo that
16:25drewrThere's also swank-clojure. Separate project.
16:25drewrGit that too.
16:27Lau_of_DKargh :)
16:27Lau_of_DKI think that link I gave you, that has settings you need to integrate into your .emacs
16:27drewrOnce you git it, read the comments in swank-clojure.clj.
16:27Lau_of_DKI'm on it
16:28Lau_of_DKBut let me just get this straight. Swank is the REPL server, and swank-clojure modifies it to evaluate clojure-code then ?
16:28Lau_of_DKhttp://github.com/jochu/swank-clojure/tree/master <-- This the one you guys are using?
16:29drewrSwank is a protocol that lets you communicate with the REPL.
16:29drewrJeffrey Chu wrote the clojure code to speak the protocol so you can use SLIME.
16:30Lau_of_DKWhat provides the server then ?
16:31drewrClojure.
16:31drewrThe REPL is still Repl.java underneath.
16:32Lau_of_DKah ok.. thanks for clearing that up
16:32Lau_of_DKI'm looking through the swank-clojure now
16:34jgracinLau_of_DK: got it!
16:34Lau_of_DKyou got it working? :)
16:34jgracinyup.
16:34Lau_of_DKalright, I'm right behind you ( I hope )
16:35jgracin(setq slime-lisp-implementations '((clojure ("/home/gracin/software/clojure/compiler/start.sh") :init clojure-init)))
16:35jgracinthe point was in :init clojure-init
16:37Lau_of_DKthat goes anywhere in my .emacs ?
16:38jgracinI'll show you what I have in my .emacs that's related to slime/clojure....
16:39Lau_of_DKDid you get that bit about the sh script ? Their .git seems to be down for the extras
16:39jgracinYou probably don't need it. Try without it first.
16:39jgracinI didn't use it.
16:42Lau_of_DKargh, dont tell me that after I got it working :)
16:43Lau_of_DKGimme 5 minz, I think I'm on the right track
16:44jgracinLau_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:45Lau_of_DKThanks alot
16:45jgracinnp
16:48Lau_of_DKthe start.sh that you execute, what is that?
16:49Lau_of_DKalso - its in /clojure/compiler/ - where did you get that lib from ?
16:55Lau_of_DKcome on jgracin , dont leave me hanging baby :)
17:02jgracinLau_of_DK: sorry. start.sh is my script that contains ...
17:02jgracinjava -cp clojure.jar clojure.lang.Repl
17:02jgracinmake the script executable
17:03Lau_of_DKwhere did you get the lib /compiler/ from ? Made it yourself, or is it because youre using a different package than me?
17:03jgracinclojure/compiler is where I keep the Clojure sources
17:04jgracinthat's where I generated clojure.jar from Clojure sources
17:04Lau_of_DKoh, you compiled it yourself? It was in the package I downloaded
17:05jgracinyes, I compiled it myself. You can use whatever you've got. The point is that it must start Clojure REPL.
17:06Lau_of_DKsure, 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:08jgracinPlace the point over slime-lisp-implementations and press "C-h v" and enter to see what the value of that variable is.
17:10jgracinMy 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:10jgracinbrb
17:11Lau_of_DKplace 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:16Lau_of_DKaha, the error that flashed was this: Symbol's value as variable is void: slime-lisp-implementations
17:19jamiiHi all. Is there a way to get the last evaluated expression in the REPL? It doesnt seem to be documented anywhere.
17:30Lau_of_DKIf you get it running in emacs its ctrl+up
17:48jgracinLau_of_DK: still there?
17:49Lau_of_DKjgracin, yea, didnt you get all my query messages?
17:49jgracinyeah, I did. Did you manage to set slime-lisp-implementations variable?
17:50Lau_of_DKI can tell you in a second
17:50jgracinLau_of_DK: oops. sorry, I didn't see your private messages until now!
17:50Lau_of_DKI just got SBCL/Slime running again
17:50jgracinLet me read them.
17:50Lau_of_DKk
17:52Lau_of_DKcould you double check our emacs file on http://www.inge-mark.hr/~gracin/myemacs I think there might be something wrong in it
18:48ericthorrhickey: since we are talking about the fast math lib, it appears to take a bit of time to load the clojure.jar.
18:48rhickeypoll: 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:50ericthorI 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:51ericthorHave you seen this on your end?
18:52rhickeya couple of secs, not something I would focus on
18:58drewrrhickey: I like the ! prefix.
18:59rhickeyalternatively, Java primitives would default to fast:
18:59rhickeyuser=> (+ (. Integer MAX_VALUE)(. Integer MAX_VALUE))
18:59rhickey-2
18:59rhickeyunless coaxed to boxed:
18:59rhickeyuser=> (+ (num (. Integer MAX_VALUE)) (. Integer MAX_VALUE))
18:59rhickey4294967294
18:59rhickeyliterals are already boxed
19:00rhickey(+ 2147483647 2147483647)
19:00rhickey4294967294
19:01Lau_of_DKI'm trying to compile clojure from the SVN, but mvn cannot find my java installation. Its located in /usr/lib/jvm/java-6-sun-1.6.0.06/ - - What do I export my $JAVA_HOME to, to get this to work ?
19:01rhickeythen just a single set of +/-/* etc
19:05Lau_of_DKkeep sleeping, I fixed it
19:09Lau_of_DKanybody still up ?
19:10Lau_of_DKLook, 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:10Lau_of_DKHow do I stop this madness? :)
19:14Lau_of_DKanybody?
19:18Lau_of_DKLook, 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:23ericthorrich: yesterday I grabbed the latest clojure and removed all the object.invoke stuff. I'm getting an error in the topological sort function:
19:24ericthorjava.lang.NoSuchFieldError: EMPTY
19:24ericthor at clojure.fns.depends.top_sort__4859.invoke(depends.clj:201)
19:24ericthor at clojure.fns.depends.get_depends__4892.doInvoke(depends.clj:298)
19:25ericthorthere 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:32Lau_of_DKLook, 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:54rhickeyeric: what is at depends.clj line 201?
21:47rhickeySVN 887 is an interim checkin - DO NOT USE!