On Wed, Mar 4, 2009 at 10:10 PM, Jason Wolfe <jawo...@berkeley.edu> wrote: > > I have a file really/long/namespace/util.clj with a bunch of > utilities, structs, and method definitions. Following (what I gather > is) an accepted convention, these structs have a :class key that maps > to a namespace-qualified keyword. > > Now, I have another file stuff.clj that builds upon all of the > contents of util.clj. So, I want to :use util.clj, pulling in all of > its utilities, but I'd also like to be able to refer to its namespace- > qualified keywords with the alias ::util/keyword rather > than :really.long.namespace.util/keyword. Is there a way for me to > do this under your proposal?
Well, there's been two proposals. In my original less radical one, I already addressed this requirement. For your example: (ns util (:use [really.long.namespace.util :as util :exclude ()])) It looks a little awkward, but it's an unusual case. The common case would become the prettier. And it has the benefit of working both now and if the proposal is in effect. Adding an :all option as Steve suggests would clean this up even more: (ns util (:use [really.long.namespace.util :as util :all])) That change would of course break nothing. The only behavior that would change with those two features would be if somebody was currently doing: (ns util (:use [really.long.namespace.util :as util])) ...and they were actually relying on both the util alias *and* the fact that all the util names were refer'ed in. I dare say that would not break much existing code, and if it did would be easy to track down and fix (by simply adding :all). --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 -~----------~----~----~----~------~----~------~--~---