Re: Exception while setting namespace from Java

2008-09-04 Thread Josip Gracin
On Thu, Sep 4, 2008 at 5:41 PM, Michael Reid <[EMAIL PROTECTED]> wrote: > On Thu, Sep 4, 2008 at 6:19 AM, Josip Gracin <[EMAIL PROTECTED]> wrote: >> Thanks, Mike! Works perfectly! (btw, only on Java 1.5 and not on 1.6. >> On 1.6 there's a problem with arguments to RT.map) > > Care to share? I've

Re: Exception while setting namespace from Java

2008-09-04 Thread Michael Reid
Hi, On Thu, Sep 4, 2008 at 6:19 AM, Josip Gracin <[EMAIL PROTECTED]> wrote: > Thanks, Mike! Works perfectly! (btw, only on Java 1.5 and not on 1.6. > On 1.6 there's a problem with arguments to RT.map) Care to share? I've been using Clojure on OpenJDK 1.6.0 for some time without trouble. This in

Re: Exception while setting namespace from Java

2008-09-04 Thread Josip Gracin
On Wed, Sep 3, 2008 at 11:48 PM, Michael Reid <[EMAIL PROTECTED]> wrote: > The key is that you need to wrap the call to in-ns in > Var.pushThreadBindings(IPersistentMap) / Var.popThreadBindings(). Thanks, Mike! Works perfectly! (btw, only on Java 1.5 and not on 1.6. On 1.6 there's a problem with

Re: Exception while setting namespace from Java

2008-09-03 Thread Michael Reid
Hi Josip, Have a look in jvm/clojure/lang/Repl.java which demonstrates creating and entering the 'user namespace. The key is that you need to wrap the call to in-ns in Var.pushThreadBindings(IPersistentMap) / Var.popThreadBindings(). This is analogous to: (binding [*ns* *ns*] ;; bind a thread-

Exception while setting namespace from Java

2008-09-03 Thread Josip Gracin
Hi! Why is the following code throwing an exception? PushbackReader rdr = new PushbackReader( new StringReader( "(in-ns 'user)" ) ); Object input = LispReader.read(rdr, false, null, false ); clojure.lang.Compiler.eval( input ); java.lang.IllegalStateException: Can't change/establish