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..
On Wed, Nov 17, 2010 at 9:51 PM, Ken Wesson <kwess...@gmail.com> wrote: > On Wed, Nov 17, 2010 at 9:36 PM, Victor Olteanu <bluestar...@gmail.com> > 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 library again in the current namespace - more > > precisely: > > 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 - essentially a function in the > > loaded library in the "db" namespace. Trying to do "db/somefunction", > > perhaps obviously, is failing. > > I then attempted to write a macro that would call a function in a > different > > namespace than the current one, but I couldn't find a way to specify a > > namespace in a macro definition. > > Why not just have, in db.clj. > > (def somefunction mylib/somefunction) > > ? > > -- > 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<clojure%2bunsubscr...@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 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