3

Are there any docs on using slimv with clojure?

I got it connected to a lein swank and have a working repl but can't figure out how to actually do anything with it. How do you get it to load a lein project and its namespaces? Tried following the tutorial but it doesn't seem to translate well to clojure. I tried telling it to load my namespace, and it seemed to work, but if I try executing one of my functions, I get:

Unable to resolve symbol: handle-text-message in this context
  [Thrown class java.lang.RuntimeException]

Restarts:
  0: [QUIT] Quit to the SLIME top level
devth
  • 2,738
  • 4
  • 31
  • 51
  • This is not quite a solution but did you try emacs+slime with clojure? Slimv should do the same for vim as slime for emacs, so first I suggest to check how to work with a lein project in emacs+slime and try to do the same in slimv. If something working in slime does not work in slimv then please report it to me and I'll fix it. – Tamas Kovacs Nov 19 '11 at 14:47
  • Did you try evaluating the whole buffer rather than just the current form? – Adrian Mouat Nov 21 '11 at 10:44
  • Yep, tried evaluating the whole buffer, but it doesn't load the namespaces in my `(:require [])` expression, so I get `NoClassDefFoundError`. – devth Nov 21 '11 at 17:42
  • 1
    Check [this](http://stackoverflow.com/questions/2854618/using-clojure-contrib-functions-in-slime-repl) topic, I think it answers some of your questions. – Tamas Kovacs Nov 21 '11 at 20:39
  • Thanks, that's helpful. I'm making progress. Looks like there's a need for a good blog post describing this. If/when I get it all figured out I'll try and write something. – devth Nov 21 '11 at 22:25

1 Answers1

2

lein swank does not start with your code loaded. It does however start with the correct classpath such that you can load your code.

In your topmost file, you can use ,b to load the entire file, and your entire program /should/ load from there.

For example, starting a swank instance at the root of https://github.com/elarkin/ants-demo will load a swank server with the classpath set correctly.

If you then connect to that swank instance in VIM (using ,c) and use ,b on the file /src/ants/ui.clj the entire program will be loaded.

You can see proof by manually running the main method (-main)

Evan Larkin
  • 377
  • 2
  • 6
  • 16