On May 31, 7:54 pm, Meikel Brandmeyer <m...@kotka.de> wrote: > It works sometimes. Of course you can redef a Var via function. > > (defn foo [y] (def x y)) > (foo 5) > > However, you cannot define arbitrary Vars. > > (defn bar [x y] (def x y)) > (bar 'c 5)
True, but that's more a question of the interface provided by def. The real problem is that if you want to access the vars defined by that function anywhere else, they need to be defined (if not initialized) before you can compile the code. Meaning you either have to def those vars somewhere else (outside of a function) or make sure the function gets called at least once before any access is mentioned in the code. After that, you can re-define the var in any way you like. -- 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 Note that posts from new members are moderated - please be patient with your first post. 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