Re: Calling function in required library in a different namespace

2010-11-17 Thread Meikel Brandmeyer
Hi, On 18 Nov., 04:48, Adrian Cuthbertson 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.c

Re: Calling function in required library in a different namespace

2010-11-17 Thread Adrian Cuthbertson
> 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

Re: Calling function in required library in a different namespace

2010-11-17 Thread Ken Wesson
On Wed, Nov 17, 2010 at 10:26 PM, Victor - wrote: > On Wed, Nov 17, 2010 at 9:51 PM, Ken Wesson wrote: >> Why not just have, in db.clj. >> >> (def somefunction mylib/somefunction) > > I used to do that before, but I realized I was introducing a level of > indirection at a stage when the exact fun

Re: Calling function in required library in a different namespace

2010-11-17 Thread Victor -
I used to do that before, but I realized I was introducing a level of indirection at a stage when the exact function signatures weren't clear yet. I do agree that the preferred final solution can well be to always call through function in the other namespace, though I think there may be exceptions.

Re: Calling function in required library in a different namespace

2010-11-17 Thread Ken Wesson
On Wed, Nov 17, 2010 at 9:36 PM, Victor Olteanu wrote: > Hi, > Please excuse my newbie ignorance - I would like to do something that seems > pretty basic, yet I couldn't figure it out yet. > I would like to call a function that is loaded in a different namespace, but > without having to load the l

Calling function in required library in a different namespace

2010-11-17 Thread Victor Olteanu
Hi, Please excuse my newbie ignorance - I would like to do something that seems pretty basic, yet I couldn't figure it out yet. I would like to call a function that is loaded in a different namespace, but without having to load the library again in the current namespace - more precisely: in db.clj