I use 'use' yes.

Take, for instance, this code. It uses my own library to generate a
series of logical statements (about pizza's -- there is a reason, daft
though it sounds). 

https://github.com/phillord/tawny-pizza/blob/master/src/pizza/pizza.clj

It isn't until around the 300th line that I first use any of the
clojure.core functions (ignoring the 'ns' directive which obviously
comes first). Quite often when I use this library, I have to use
refer-clojure to switch the implicit clojure.core use off, because it
gets in the way; I would do the same thing with java.lang if I could but
as far as I can tell those symbols are there regardless of what I do.

I would defend this usage of use. I do not want to namespace qualify the
tawny.owl library; why should I do this when I have hundreds of calls to
this library and about 5 to clojure.core?

I'm happy for you to tell me why I am wrong on this. From this thread, I
understand I could achieve the same thing with :require and more typing;
this is not the point; pulling in one namespace into another sometimes
makes sense.

Phil



Gary Trakhman <gary.trakh...@gmail.com> writes:

> We should scour clojuresphere for uses of 'use' and automatically post
> github issues to the projects of interest, and redefine the ns macro to
> issue a warning with use.
>
> Does anyone actually like 'use'?
>
> Require is always more evident.
>
>
> On Tue, Jul 23, 2013 at 2:17 PM, Jozef Wagner <jozef.wag...@gmail.com>wrote:
>
>> +1, :use is IMO an antipattern.
>>
>> I hate it mainly in blogs, where they explain some new API. They :use like
>> 3 namespaces and you have to guess which fn is from which ns :)
>>
>> JW
>>
>>
>> On Tuesday, July 23, 2013 5:50:50 PM UTC+2, Greg Slepak wrote:
>>>
>>> I think I read somewhere that :use is no longer encouraged, but I could
>>> be mistaken.
>>>
>>> From what I've read, it seems like most people agree that Clojure has too
>>> many ways of including/importing/**referencing/requiring/using things:
>>>
>>> http://blog.8thlight.com/**colin-jones/2010/12/05/**
>>> clojure-libs-and-namespaces-**require-use-import-and-ns.html<http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html>
>>>
>>> The above gives a very nice explanation of all the various difference,
>>> but it also acknowledges their complexity.
>>>
>>> Since :use uses :require, and since :require can do everything that :use
>>> can, can we simplify Clojure programming a bit for newcomers by deprecating
>>> the use of :use? The situation in ClojureScript is even worse because it
>>> adds :require-macros on top of all the other ways of including files.
>>>
>>> Ideally, it would be awesome if there was just a single directive for
>>> everything, but perhaps there's some complicated low-level reason why
>>> that's not possible. :-\
>>>
>>> Thoughts?
>>>
>>> Thanks,
>>> Greg
>>>
>>> P.S. If this has already been brought up you have my sincere apologies.
>>>
>>> --
>>> Please do not email me anything that you are not comfortable also sharing
>>> with the NSA.
>>>
>>>  --
>> --
>> 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.
>>
>>
>>
>
> -- 

-- 
Phillip Lord,                           Phone: +44 (0) 191 222 7827
Lecturer in Bioinformatics,             Email: phillip.l...@newcastle.ac.uk
School of Computing Science,            
http://homepages.cs.ncl.ac.uk/phillip.lord
Room 914 Claremont Tower,               skype: russet_apples
Newcastle University,                   twitter: phillord
NE1 7RU                                 

-- 
-- 
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.


Reply via email to