Re: Rebinding Defs

2011-03-09 Thread Chris Perkins
On Mar 9, 7:31 am, Chris Perkins wrote: > On Mar 8, 6:59 pm, Timothy Baldridge wrote: > > > If in a namespace I bind a var: > > > (def foo 3) > > > And then later on in my program re-bind that var: > > > (def foo 1) > > > Will all parts of my program instantly see that update? How is it > > possi

Re: Rebinding Defs

2011-03-09 Thread Alan
On Mar 9, 12:00 am, Tassilo Horn wrote: > Alan writes: > > Hi Alan, > > > And yes, it slows things down a bit, so in 1.3 the default is to not > > support rebinding (though re-def'ing is still supported). > > What do you mean by doesn't support rebinding?  Does that mean, that > things like > >  

Re: Rebinding Defs

2011-03-09 Thread Chris Perkins
On Mar 8, 6:59 pm, Timothy Baldridge wrote: > If in a namespace I bind a var: > > (def foo 3) > > And then later on in my program re-bind that var: > > (def foo 1) > > Will all parts of my program instantly see that update? How is it > possible to have any sort performance when we're basically hav

Re: Rebinding Defs

2011-03-09 Thread Tassilo Horn
Baishampayan Ghose writes: Hi! >> What do you mean by doesn't support rebinding?  Does that mean, that >> things like >> >>  (def foo false) >>  (binding [foo true] (dostuff)) >>  (let [foo true] (dostuff) (println foo)) > > Not allowed unless you mark `foo' as dynamic. The syntax looks like thi

Re: Rebinding Defs

2011-03-09 Thread Baishampayan Ghose
>> And yes, it slows things down a bit, so in 1.3 the default is to not >> support rebinding (though re-def'ing is still supported). > > What do you mean by doesn't support rebinding?  Does that mean, that > things like > >  (def foo false) >  (binding [foo true] (dostuff)) >  (let [foo true] (dost

Re: Rebinding Defs

2011-03-09 Thread Tassilo Horn
Alan writes: Hi Alan, > And yes, it slows things down a bit, so in 1.3 the default is to not > support rebinding (though re-def'ing is still supported). What do you mean by doesn't support rebinding? Does that mean, that things like (def foo false) (binding [foo true] (dostuff)) (let [f

Re: Rebinding Defs

2011-03-08 Thread Timothy Baldridge
> Is there a reason you're using a var rather than an atom or a ref? > I think I over-simplified what I'm doing a bit. What I'm really doing is writing a prototype port of Clojure to PyPy. I'm planning to make symbols resolvable at compile-time. It sounds like in most cases, like for defs, I should

Re: Rebinding Defs

2011-03-08 Thread James Reeves
Typically an atom or a ref is used when you want a variable On 8 March 2011 23:59, Timothy Baldridge wrote: > If in a namespace I bind a var: > > (def foo 3) > > And then later on in my program re-bind that var: > > (def foo 1) > > Will all parts of my program instantly see that update? How is it

Re: Rebinding Defs

2011-03-08 Thread Alan
On Mar 8, 3:59 pm, Timothy Baldridge wrote: > If in a namespace I bind a var: > > (def foo 3) > > And then later on in my program re-bind that var: > > (def foo 1) > > Will all parts of my program instantly see that update? How is it > possible to have any sort performance when we're basically hav

Rebinding Defs

2011-03-08 Thread Timothy Baldridge
If in a namespace I bind a var: (def foo 3) And then later on in my program re-bind that var: (def foo 1) Will all parts of my program instantly see that update? How is it possible to have any sort performance when we're basically having a namespace function lookup for every single function cal