On Aug 2, 2013, at 9:16 AM, Laurent PETIT wrote:
> 2013/8/2 Anthony Grimes <disciplera...@gmail.com>:
>> Keep in mind that you should almost never do this. It's much better to
>> require :as or explicitly refer which things you want from each namespace.
>> When you do :refer :all, you pollute your namespace with tons of vars and
>> when you use them, nobody has any clue where they're coming from so they
>> have to hunt through the codebase, your libraries, etc, to find out where
>> the various vars you're using come from. All of that is mitigated by
>> referring specific vars or qualifying the namespace with :as. It really
>> isn't that many more characters. You can give your namespace a one letter
>> prefix and access vars like x/some-var.
> 
> True.
> 
> Tho note that with an IDE (Counterclockwise for Clojure does that for
> instance) with good integration with nrepl, you can hover over the
> symbol (provided that you've successfully loaded the namespace in your
> repl) to see documentation (including where it comes from), type F3 to
> jump to its definition (either in your project files, or in jar
> entries).

Laurent's point that an IDE can tell you where things are defined is an 
excellent one, but I'd go further and contest Anthony's assertions that "you 
should almost never do this" and that it's "much better to require :as or 
explicitly refer which things you want from each namespace." 

I can believe that these assertions are true in some (maybe many) programming 
contexts, but from other perspectives anything that requires you to type stuff 
that's not directly about the problem you're trying to solve or the idea you're 
trying to express can be seen as an anti-feature. In my own case I generally 
don't want to spend my time maintaining catalogs of all of the locations of the 
functions that I call or cluttering up function calls with project plumbing; I 
want to spend my time thinking about and developing and testing my algorithms.

I do understand that explicitness is good when you're writing code for 
mission-critical production environments, etc. But in other programming 
contexts (most of mine, and most of my students', and most of my 
collaborators') it's more important to be able to write code quickly and 
fluidly, without worrying about the plumbing.

In this context the OP's request was perfectly reasonable, and the right 
combination of :require, :refer :all, and :exclude is a reasonable way to do 
the job. I'd personally like it even better if you could accomplish the same 
thing without listing the conflicts explicitly, but I'm sure that will seem 
totally nuts to others.

 -Lee

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