Re: Compiling a namespace causes subsequent uses of it to fail.

2010-06-24 Thread philip.hazel...@gmail.com
On Jun 23, 12:29 pm, Stuart Halloway stuart.hallo...@gmail.com wrote: I think the behavior you are seeing here is reasonable. When you mix compilation and dynamic access to vars, you need to reason carefully about the order in which things will happen. In general I would say that code

Re: Compiling a namespace causes subsequent uses of it to fail.

2010-06-23 Thread Stuart Halloway
I think the behavior you are seeing here is reasonable. When you mix compilation and dynamic access to vars, you need to reason carefully about the order in which things will happen. More usefully: you can write a test in your var-get expression that will make it do what you want in all

Compiling a namespace causes subsequent uses of it to fail.

2009-09-07 Thread philip.hazel...@gmail.com
(ns testcomp) (var-get (or (ns-resolve *ns* 'foo) (intern *ns* 'foo :foo))) ;; foo ;(1) ;; (println foo) ;(2) ;; (do foo 3);(3) ;; (fn [] foo) ;(4) ;; ((fn [] foo)) ;(5) ;; ((fn [] (println foo))) ;(6)