Hi,

On 18 Nov., 04:48, Adrian Cuthbertson <adrian.cuthbert...@gmail.com>
wrote:

> > in db.clj
> > I have
> >  (:require [some-library :as mylib])
> > in api.clj:
> > I have (:require [myapp.db :as db])
> > I then want to call mylib/somefunction -
>
> You can use "some-library/..." directly after requiring db, e.g;
>
> xxlib.clj...
> (ns xxlib)
> (defn xxfoo [] :xxfoo)
>
> db.clj...
> (ns db
>   (:require [xxlib :as mylib]))
> (defn dbfoo[] :dbfoo)
>
> repl...
> Clojure 1.2.0
> (require ['db :as 'db])
> (xxlib/xxfoo)
> :xxfoo

Please, no! This hides the dependency on a third library. As long as
automatic loading for unresolved namespace references is in place,
this is not a good idea. And even then an explicit require should be
preferred.

What is wrong about: (require '[myapp.db :as db] '[some.xxl.ib :as
some-lib])?

Sincerely
Meikel

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