On Thu, May 13, 2010 at 2:06 PM, j-g-faustus <johannes.fries...@gmail.com>wrote:

> Hi,
>
> just started looking at Clojure, and it looks promising as a modern-
> day Lisp for practical use.
>
> I saw this presentation on Clojure: http://clojure.blip.tv/ and I
> wholeheartedly agree with the design principles. Unified access to all
> kinds of collections (list, array, struct, hash) is something I sorely
> missed in CL back in the day (late 90's), and I like the focus on
> practical programming in the modern world (multicore/multithread,
> leveraging existing libraries, a stable and mature VM plaform etc.).
> Looking forward to getting to know Clojure better.
>
> But I have a question: Why are there *four* ways to do an import, each
> with slightly different syntax and semantics?
>

:refer shouldn't be used by you at all.

:import brings in java classes

:use brings in the names from another clojure namespace without requiring
namespace qualifications

:require brings in the names from another clojure namespace requiring
namespace qualifications.

So if ns foo has a var bar, if you do (use 'foo), you can just refer to bar,
but if you do (require 'foo), you have to say foo/bar, not just bar.

It is quite common for me to use all three, use, require, and import, in the
same namespace declaration, as they do three different things.

If I had to get rid of one, I'd get rid of use.  But it's nice in some
circumstances.

Brian

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

Reply via email to