Hi,

I'm trying to use org-mode with clojure. However, my problem is, that all 
functions are evaluated in the 'user' namespace. Basically, I have 
something like this:

#+BEGIN_SRC clojure
 (ns environment.my-test
  (:gen-class)
  (:require [clojure.java.io :refer :all]))
#+END_SRC

#+RESULTS:
: nil

#+BEGIN_SRC clojure
(defn my-reader
  "Read clojure structure"
  [filename]
  (with-open [r (java.io.PushbackReader. (reader filename))]
  (binding [*read-eval* true]
    (read r))))
#+END_SRC

NO RESULT HERE AS 'reader' is undefined!
Workaround: use clojure.java.io/reader

#+BEGIN_SRC clojure
(defn add [x y] (+ x y))
#+END_SRC

#+RESULTS:
: #'user/add

--> namespace 'user' instead of environment.

How can I modify my org-file, so that the correct namespace is used? I've 
tried the :session keyword and the tips on this page:
http://nakkaya.com/2013/04/06/using-clojure-with-org-babel-and-nrepl/
but neither of them worked.
Can I use the :session keyword in order to use different namespaces in my 
.org file?

Thank!

Regards, Volker





-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to