here is my code:

(comment
Sample clojure source file
)
(ns com.yourcompany.defpackage
    (:gen-class))

(defmacro macro-hello []
  `"hello")

(defn -main []
  (println (eval '(= 0 0))) ;works
  (println (eval '(com.yourcompany.defpackage/macro-hello))) ;works
  (println (eval `(macro-hello))) ;works
  (println (eval '(macro-hello))) ;does not work
  )


seems that backquote resolves namespace while quote doesn't.

Can you point me in the right direction concerning backquote and
quote?

On Aug 20, 4:41 pm, Chouser <chou...@gmail.com> wrote:
> On Thu, Aug 20, 2009 at 6:58 PM, gutzofter<gutzof...@gmail.com> wrote:
>
> > In common lisp I can do this:
>
> > src-> (defmacro macro-hello () `"hello")
>
> > (eval '(macro-hello))
>
> > no problem.
>
> > In clojure:
>
> > (defmacro macro-hello [] `"hello")
>
> > (eval '(macro-hello))
>
> > gives me an error.
>
> Works for me:
>
> Clojure 1.1.0-alpha-SNAPSHOT
> user=> (defmacro macro-hello [] `"hello")
> #'user/macro-hello
> user=> (eval '(macro-hello))
> "hello"
>
> Are you doing something unusual with namespaces,
> or doing both expressions in a single top-level form?
>
> --Chouser
--~--~---------~--~----~------------~-------~--~----~
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