Re: Rebinding vars at compile time

2010-03-12 Thread Kevin Downey
there are a number of vars that are bound in clojure.main's repl, *assert* is one of them. So in the repl you can use set!. On Thu, Mar 11, 2010 at 3:25 PM, Benjamin Teuber wrote: >> > (def *assert* false) >> >> You cannot use def to change the value of a var in another namespace. >> This is noth

Re: Rebinding vars at compile time

2010-03-11 Thread Benjamin Teuber
> > (def *assert* false) > > You cannot use def to change the value of a var in another namespace.   > This is nothing specific to *assert* or to clojure.core. > Here is what you can do instead: > >         (alter-var-root (var *assert*) (fn [_] false)) I actually tried from inside clojure.core,

Re: Rebinding vars at compile time

2010-03-07 Thread Konrad Hinsen
On 7 Mar 2010, at 21:03, Benjamin Teuber wrote: Another idea would be to alter the root binding of *assert* instead. I guess this solution would work for your own vars, but unfortunately it is not possible to do this with *assert*: (def *assert* false) You cannot use def to change the value o

Re: Rebinding vars at compile time

2010-03-07 Thread CuppoJava
I agree that the issue with not being to change the root value of *assert* seems odd. But I actually like the macroexpand-all solution. It's done at compile- time, so performance is not a big problem, and clojure's macroexpand resolves everything to the proper namespace anyway. -Patrick -- Yo