Re: Defining a namespace inside a let

2010-05-07 Thread Stuart Sierra
On May 2, 3:09 pm, alux wrote: > Hm. Can you point me to some documentation about these special rules > then? Some on http://clojure.org/namespaces But the best rule of thumb is: never use "ns" or "in-ns" anywhere except at the top of a source file. -S -- You received this message because you

Re: Defining a namespace inside a let

2010-05-02 Thread alux
Hello Stuart, "they don't work as you'd expect". Ah, I see. Thank you ;-) Hm. Can you point me to some documentation about these special rules then? Many thanks, alux On 30 Apr., 18:10, Stuart Sierra wrote: > "ns" and "in-ns" have special evaluation rules.  In general, they > don't work as

Re: Defining a namespace inside a let

2010-04-30 Thread Stuart Sierra
"ns" and "in-ns" have special evaluation rules. In general, they don't work as you'd expect in block expressions such as "do" or "let". If you want to create namespaces programatically, use "create-ns" and "intern". -SS On Apr 26, 6:25 pm, David McNeil wrote: > I am experimenting with clojure

Re: Defining a namespace inside a let

2010-04-30 Thread Armando Blancas
In a clean repl: C:\>repl Clojure 1.2.0-master-SNAPSHOT user=> (println (do (ns ns-1) (def my-namespace *ns*) my-namespace)) # nil ns-1=> On Apr 30, 1:17 am, alux wrote: > Hello Armando, did you try the second half of you experiment in a > clean REPL? > > As you describe it, the first evaluation

Re: Defining a namespace inside a let

2010-04-30 Thread alux
Hello Armando, did you try the second half of you experiment in a clean REPL? As you describe it, the first evaluation may have created the var. Regards, alux On 29 Apr., 21:32, Armando Blancas wrote: > > The REPL switches to the namespace ns-1 and the var my-namespace is in > > user ! > > > I

Re: Defining a namespace inside a let

2010-04-29 Thread Armando Blancas
> The REPL switches to the namespace ns-1 and the var my-namespace is in > user ! I don't see that with CLJ 1.2 on Windows: user=> (do (ns ns-1) (def my-namespace *ns*) my-namespace) # ns-1=> (ns user) nil user=> (println (do (ns ns-1) (def my-namespace *ns*) my-namespace)) # nil ns-1=> (var my-n

Re: Defining a namespace inside a let

2010-04-29 Thread alux
Hello, interesting. Is this a bug?? Somehow the println seems to do strange things here. If I evaluate in namespace user (do (ns ns-1) (def my-namespace *ns*) my-namespace) The REPL switches to the namespace ns-1 and the var my-namespace is in ns-1 If I evaluate in namespace user (print

Re: Defining a namespace inside a let

2010-04-28 Thread Nate Young
On Apr 26, 5:25 pm, David McNeil wrote: > I am experimenting with clojure.test and I encountered the following > situation which I cannot explain. > > This code: > > (println (do >            (ns ns01 >              (:use clojure.test)) >            (deftest test1 nil) >            (run-tests))) >

Re: Defining a namespace inside a let

2010-04-27 Thread Adrian Cuthbertson
Not sure about your specific case, but when you don't get back expected results it's usually due to the functions called being lazy. Try doall or dorun to force the iterations. -Rgds, Adrian. On Tue, Apr 27, 2010 at 12:25 AM, David McNeil wrote: > I am experimenting with clojure.test and I encou