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 clo...@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+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
The require should be:
(ns bkell
(:require commands))
and then you'll reference the functions as (commands/add ...)
(commands/remove ...) etc.
I'm not sure why (:require commands.remove) doesn't give you an
error... perhaps it was pulling in commands/remove.clj anyway?
Is there any reason why you have the commands split across multiple
files? (I'm not saying it's bad, just curious)
I suspect you're somehow calling remove recursively (but it's hard to
tell without seeing more of your code).
Sounds like you're gradually getting a handle on namespaces...
Yes. If you look at how various projects work with multiple files in a
single namespace, I think they have a file for the namespace that then
loads the others (which are part of that namespace). See this SO Q&A
for an example:
http://stackoverflow.com/questions/4690758/splitting-a-clojure-namespace-over-multiple-files