Re: surprising behaviour with do, ns and def

2009-07-14 Thread Chris Kent
Hi Stuart Thanks for the explanation, that makes sense and I very much doubt I'd have figured that out by myself without a lot of head scratching. And you were right about the intern function, that does exactly what I was looking for. Cheers Chris On Jul 14, 3:04 am, Stuart Sierra wrote: > On

Re: surprising behaviour with do, ns and def

2009-07-13 Thread Stuart Sierra
On Jul 13, 3:58 pm, Chris Kent wrote: > user=> (ns a) (def foo "foo") > a=> #'a/foo > a=> > > If the same code is executed inside a do form the var is defined in > the original namespace.  I thought that the do should make no > difference.  Is this the intended behaviour? > > user=> (do (ns a) (d

surprising behaviour with do, ns and def

2009-07-13 Thread Chris Kent
I've noticed that changing namespace with ns and then doing a def doesn't behave the same inside a do form: Without the do form it works as expected: user=> (ns a) (def foo "foo") nil a=> #'a/foo a=> If the same code is executed inside a do form the var is defined in the original namespace. I