Hey, thanks for getting back to me.

I was hacking away at this at the meantime. I defined 'remove' functions in
2 other places - bkell , commands. I ended up renaming *commands/remove* to
*commands/removek*, and now all invocations are working. But I'm pretty sure
I'm using namespace and require erroneously. Currently, I have a source file
structure like below:

src/
   bkell.clj
src/commands/
   add.clj
   remove.clj
   etc...


But each of the 'src/commands/' clojure files, uses the '*(ns command ...)*'
namespace, not '*(ns command.remove ...)*', etc. I wanted to do it this way,
so that client code could just call *command/remove*, not *
command.remove/remove*. But I'm realising that I should instead define (ns
commands) once, and use (in-ns) in other locations. You can see the source
here <https://github.com/twashing/bkell/tree/jasmine-bdd/src>. Looks like
'get' can be redefined in two other namespaces: bkell , commands. But when I
try to do that for 'remove', the repl seizes up, and I'm curious to know
why.

Thanks for the feedback
Tim



On Sun, Sep 4, 2011 at 3:56 PM, Sean Corfield <seancorfi...@gmail.com>wrote:

> On Sun, Sep 4, 2011 at 11:37 AM, Timothy Washington <twash...@gmail.com>
> wrote:
> > (ns bkell
> >   (:import java.io.FileReader)
> >   (:require commands.add)
> >   (:require commands.update)
> >   (:require commands.get)
> >   (:require commands.remove)
> >   (:require commands.authenticate)
> >   (:require domain)
> >   (:require util)
> > )
>
> These are requiring namespaces so I would expect you'd have a
> namespace commands.remove and it would contain functions...?
>
> > (defn remove [akey & etal]
> >   (let [  logged-in-user (commands/logged-in-user)]
> >     (if (-> logged-in-user nil?)  ;; we want to see a logged-in-user
> >       (util/generate-error-response "User is not authenticated")
> >       (eval `(commands/remove ~akey ~@etal))     ;; this is line 61
> >     )
> >   )
> > )
>
> I would expect to see (commands.remove/some-func ..) here... so I'm a
> little puzzled when you say it works for invoking functions in other
> require'd commands.* namespaces. Can you share a bit more of your
> code?
> --
> Sean A Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
> World Singles, LLC. -- http://worldsingles.com/
> Railo Technologies, Inc. -- http://www.getrailo.com/
>
> "Perfection is the enemy of the good."
> -- Gustave Flaubert, French realist novelist (1821-1880)
>
> --
> 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 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