I found the old thread below, but unfortunately the solution isn't working for me. If I have a foo.clj file in a buffer and evaluate region on
(defn foo [] (+ 1 2)) I get #'user/foo in the minibuffer. If I then evaluate region on (foo) I get 3 in the minibuffer. The slime REPL is giving me a prompt user> so I'm assuming it's in the user namespace, but I can't seem to get expressions from the text buffer to evaluate in there. On Mar 28, 5:01 am, Michał Marczyk <michal.marc...@gmail.com> wrote: > On 27 March 2010 22:25, alux <alu...@googlemail.com> wrote: > > > But now I see people use the result of this evaluation in their REPL > > (I see this in videos, so I cant ask 'em :). This doesnt work at all > > for me. I get the result in the minibuffer (this thing at the very > > bottom) and thats it. > > If the form you evaluate is of the def* variety, it's going to affect > the namespace it resides in and not the namespace of the REPL. Thus, > if you have e.g. (ns foo) at the top of the file, yet you're working > in the user namespace at the REPL, then after using C-x C-e to > evaluate a function definition in your file, you'll have to say > something like foo/bar to reach it from the REPL. (Or (use :reload-all > 'foo), if you prefer.) > > If there is no namespace declaration in the file, then the expression > will be evaluated in the user namespace, which means that you'll be > able to use it straight away if that's your REPL's namespace. (If you > say (in-ns 'foo) or (ns foo) at the REPL, then you'll have to say > something like user/bar to reach your function.) > > Sincerely, > Michał -- 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 Note that posts from new members are moderated - please be patient with your first post. 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