سؤال

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
هل كانت مفيدة؟

المحلول

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)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top