Re: def inside a function / set object null

2011-01-30 Thread David Steiner
You just discard all references to an object. And then afterwards I called (makea), creating a new 'a object. But then why does it throw an exception when I deref it? I searched the archives and learned that my intended coding style (using global vars) isn't idiomatic:

def inside a function / set object null

2011-01-29 Thread David Steiner
Hi all, i stumbled upon this code, and am curious why it's not working: user (defn makea [] (def a 232)) #'user/makea user (makea) #'user/a user a 232 user (ns-unmap *ns* 'a) nil user (makea) #'user/a user a --- Unable to resolve symbol: a in this context [Thrown class

Re: def inside a function / set object null

2011-01-29 Thread Ken Wesson
On Sat, Jan 29, 2011 at 5:42 PM, David Steiner davidsteiner2...@gmail.com wrote: another question i had: is there a way to destroy java objects in clojure? how do i set an object to null, so the garbage collector can do it's thing? You just discard all references to an object. Clojure's