I've given some functions metadata that I want to use elsewhere. My problem is, I don't see the metadata I've added if I use or require the namespace; I need to explicitly load the file (or eval the function definitions manually in slime/swank) to see the metatada. Here's some simple code that shows my problem. What am I doing wrong, or not understanding about metadata?
;;; ================ in the repl (output wrapped) ================ user=> (use 'ctest.core) nil user=> ; I expect wadl-meta to contain the metadata added in funcs.clj user=> ; but it does not. (Note; output is wrapped for this email) user=> ctest.core/wadl-meta ({:ns #<Namespace ctest.funcs>, :name f1} {:ns #<Namespace ctest.funcs>, :name f2}) user=> ; The problem isn't with the definition of wadl-meta. user=> (meta ctest.funcs/f1) {:ns #<Namespace ctest.funcs>, :name f1} user=> ; Now I load the file directly (or eval the defn in Emacs) user=> (load-file "src/ctest/funcs.clj") #'ctest.funcs/f2 user=> ; Look! I can see the metadata I defined now. WHY?????? user=> (meta ctest.funcs/f1) {:ns #<Namespace ctest.funcs>, :name f1, :file "ctest/funcs.clj", :line 3, :arglists ([]), :wadl {:url "/f1", :method "GET", :doc "The f1 function."}}
On Thu, May 27, 2010 at 3:28 PM, Jim Menard <jim.men...@gmail.com> wrote: > I've given some functions metadata that I want to use elsewhere. My > problem is, I don't see the metadata I've added if I use or require > the namespace; I need to explicitly load the file (or eval the > function definitions manually in slime/swank) to see the metatada. > Here's some simple code that shows my problem. What am I doing wrong, > or not understanding about metadata?
On Thu, May 27, 2010 at 9:59 AM, Christophe Grand <christo...@cgrand.net> wrote: > Hi,
> On Thu, May 27, 2010 at 3:28 PM, Jim Menard <jim.men...@gmail.com> wrote:
>> I've given some functions metadata that I want to use elsewhere. My >> problem is, I don't see the metadata I've added if I use or require >> the namespace; I need to explicitly load the file (or eval the >> function definitions manually in slime/swank) to see the metatada. >> Here's some simple code that shows my problem. What am I doing wrong, >> or not understanding about metadata?
> There you see that the fn got the previous metadata and not the current. I'm > going to open a ticket.
> Christophe
> -- > 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+unsubscribe@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en
On Thu, May 27, 2010 at 4:52 PM, Jim Menard <jim.men...@gmail.com> wrote: > Christophe,
> Thank you for your research and for opening the ticket.
> Jim
> On Thu, May 27, 2010 at 9:59 AM, Christophe Grand <christo...@cgrand.net> > wrote: > > Hi,
> > On Thu, May 27, 2010 at 3:28 PM, Jim Menard <jim.men...@gmail.com> > wrote:
> >> I've given some functions metadata that I want to use elsewhere. My > >> problem is, I don't see the metadata I've added if I use or require > >> the namespace; I need to explicitly load the file (or eval the > >> function definitions manually in slime/swank) to see the metatada. > >> Here's some simple code that shows my problem. What am I doing wrong, > >> or not understanding about metadata?
> > There you see that the fn got the previous metadata and not the current. > I'm > > going to open a ticket.
> > Christophe
> > -- > > 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+unsubscribe@googlegroups.com<clojure%2Bunsubscribe@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+unsubscribe@googlegroups.com<clojure%2Bunsubscribe@googlegroups.com > > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en