On Tue, Mar 17, 2009 at 6:40 AM, Elena <egarr...@gmail.com> wrote: > > I'm writing a Clojure source file. I thought that C-M-x (slime-eval- > defun) would send the current toplevel form to the REPL but I was > wrong. For instance, if I evaluate: > > (ns test > (:import (java.net InetAddress))) > > from the source file and then I evaluate *ns* at the REPL, I get: > > #<Namespace user> > > whilst if I copy and paste the form at the REPL and then I evaluate > *ns* , I get: > > #<Namespace test> > > which is what I would have expected in the first instance. What am I > missing? (I'm a SLIME newbie) > > Thanks >
Elena, you can think of C-M-x as restoring the original *ns* after evaluating the form. After evaluating that ns form, you can evaluate (find-ns 'test) in the REPL and see that the test namespace was created; it's just that the REPL thread was never changed into test. In addition, if you evaluate another form like (defn hi [] :hi) test/hi will be available for future evaluations. If you want to set the REPL package from your .clj buffer, use C-c M-p (slime-repl-set-package). Shawn --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---