hmm.. so how do we get the file name inside our macro?? Sunil. On Thu, Dec 9, 2010 at 2:57 PM, Ken Wesson <[email protected]> wrote:
> On Thu, Dec 9, 2010 at 4:20 AM, Sunil S Nandihalli > <[email protected]> wrote: > > Hello everybody, > > I would like to know what meta info does &form that get passed to your > > macro.. actually contain? I am able to only get the line number.. Is > there a > > way to get the file name aswell? > > user=> (defmacro foo [x] `(quote ~(meta &form))) > #'user/foo > user=> (foo bar) > {:line 380} > > <in faddle.clj> > > (ns faddle) > (defmacro foo [x] `(quote ~(meta &form))) > (defn futz [] (foo bar)) > > <load-file> > > #'faddle/futz > user=> > > <change-repl-to-file-ns> > > faddle=> (futz) > {:line 3} > > No. It looks like the &form meta contains only the :line key. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > [email protected]<clojure%[email protected]> > 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 [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
