On Monday, 5 August 2013 11:35:22 UTC+1, Phillip Lord wrote: > Anthony Grimes <discip...@gmail.com <javascript:>> writes: > > I can't think of a single good reason to not deprecate :use. :require > can > > do everything :use could do now. > > Wait for it, wait for it.... > > > This isn't about whether or not (:use ..) without :only is bad. I'd go > as > > far as to say that outside of test files (and sometimes not even those) > and > > repl sessions, :use without :only is objectively bad. > > Yeah, you see, you can think of a single good reason, although you then > contradict yourself just to make it clear that it's not the case. > > I mean, is there really any good reason why namespace qualifing > "deftest" should be necessary. Reason -- it's familiar and there are not > that many functions in clojure.test. > > Another good reason, I have given before. I have written hundreds of > lines of code, with *no* calls at all to clojure.core, and lots to my > own library. Why under these circumstances is using clojure.core by > default and requiring my own library conducive to clear code? > > > > Not much justification you can give me that'll make it unbad. But that > > isn't what this is about. Deprecating :use doesn't make doing the > > aforementioned bad thing impossible, and :refer :all was added to > > require for that specific purpose. :require still lets you do bad > > things if you really want to. All we're doing by deprecating :use is > > removing cruft and making things less complicated for new people. We > > currently have two things, and one of them does all the things the > > other one does and more, yet we still have both of them. > > > Essentially, there are four things that can be done here. You can make > a function available (require), you make it usable by it's name (use), > you can make it available by it's namespace (refer), or you can make it > available to another name (aliasing). >
+1 to this - different operations deserve different names. I'd add that there are many situations, especially when using DSLs, where you don't really want your code cluttered with aliases. It's just unnecessary noise - what you want to do is set up your namespace and have the relevant functions directly available as appropriate for you domain. Aliases can also get problematic when you have to manage code that starts to have multiple aliases defined differently in different places. It makes refactoring / transferring code between namespaces much more fiddly, especially when code that used one alias in one namespace needs to be converted to use a different alias in another namespaces (also, aliases can collide too.....). If you don't like"use" then just don't put it in your own code. But removing helpful existing functionality that many people have in their code bases as a breaking change just because some other people don't want to use it is bad language design IMHO. > > The changes suggested do nothing toward reducing these things. As you > say, you will still able to do all of them. New people will find be > introduced to "use" in the repl and find no equivalent in the ns > directive. And lots of people will have to replace ":use" directives > with something else which does the same, but is longer. -- -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.