On Thu, Feb 12, 2009 at 7:10 PM, Conrad <drc...@gmail.com> wrote: > > Hi, is there a standard way to tell if a variable is bound? I couldn't > find a way. > Basically I want something like this, but without the horrible hacks: > >> (def foo 33)
That's actually doing two different steps: 1. creating a Var named 'foo in your current namespace 2. setting the root binging of the Var to 33 Before 1, (resolve 'foo) will return false. If you do just (def foo), only step 1 will happen, after which (resolve 'foo) will return the Var, but (.hasRoot (resolve 'foo)) will return false. After step 2, (.hasRoot (resolve 'foo)) will return true, and @(resolve 'foo) will return the value, in this case 33. --Chouser --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---