On Mon, Aug 5, 2013 at 11:14 AM, Timothy Baldridge <tbaldri...@gmail.com>wrote:

> On that subject when last discussed, it was mentioned that Clojure doesn't
> have a import * method because it's basically impossible to implement.
>

Well, surely the word "impossible" is inaccurate, since other languages
(e.g., Scala) do it.


>
> To quote Rich: "Java packages are not enumerable. The only way to do so
> is to walk the classpath/jars etc. I don't think import * is a good idea,
> as it brings more into a namespace than you are going to use, making Clojure's
> namespace enumeration, e.g. ns-imports, that much less useful. "
>

The argument for wildcards is very simple.  Go to just about any Java
tutorial, for example:
http://docs.oracle.com/javase/tutorial/displayCode.html?code=http://docs.oracle.com/javase/tutorial/2d/images/examples/LoadImageApp.java

The sample code starts off with a dozen wildcard imports.  If I want to try
to use these techniques in Clojure, I have absolutely no idea which
specific classes to require.  This creates a tremendous obstacle to
consuming Java libraries.  This has affected me personally on several
occasions, preventing me from successfully figuring out how to use some
Java library from Clojure.

Maybe it's not ideal if Clojure has to walk the classpath, but the
alternative is that I have to manually walk the classpath and jars myself
with no idea what I'm looking for.  Surely it's better for this to be
handled through an automated process.

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