(.toString *ns*) On Sun, Apr 5, 2009 at 12:39 PM, Stephen C. Gilardi <squee...@mac.com> wrote: > > On Apr 5, 2009, at 3:23 PM, dysinger wrote: > >> I need coffee - too many typos. I meant to say "I am trying to avoid >> _typing_ 'x.y.z' twice" >> >> (str (the-ns 'user)) is is even more human-error prone than just >> typing "user". >> >> I was look for a way to introspect ns (DRY up the Logger/getLogger >> call). In java you could just Logger.getLogger(this.getClass().getName >> ()) or something so you are not prone to typos and it's refactor- >> friendly. > > If you want the name of the current namespace as a string, here's one way: > > (-> *ns* ns-name name) > > --Steve > >
-- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---