Re: howto use reify in defmacro

2013-12-18 Thread Tassilo Horn
"Joe (Zhou Xiangtao)" writes: > that's great, thanks. I current use a function wrap reify, it's > simple. > > (defn make-reify [entity] ...) > > (defmacro def-site-entity > `(let [e# (create-e)] >(def ~ent (make-reify e# That's even better. ;-) Bye, Tassilo -- -- You received this me

Re: howto use reify in defmacro

2013-12-18 Thread Joe (Zhou Xiangtao)
hi Tassilo, that's great, thanks. I current use a function wrap reify, it's simple. (defn make-reify [entity] ...) (defmacro def-site-entity `(let [e# (create-e)] (def ~ent (make-reify e# Joe On Wed, Dec 18, 2013 at 8:14 PM, Tassilo Horn wrote: > Xiangtao Zhou writes: > > Hi! > > >

Re: howto use reify in defmacro

2013-12-18 Thread Jim - FooBar();
as an aside, if you're writing def-like macros, I'd encourage you to look at 'clojure.tools.macro/name-with-attributes' Jim On 18/12/13 12:14, Tassilo Horn wrote: Xiangtao Zhou writes: Hi! I want to use reify in macro, but the namespace is the problem. the following code shows what have d

Re: howto use reify in defmacro

2013-12-18 Thread Tassilo Horn
Xiangtao Zhou writes: Hi! > I want to use reify in macro, but the namespace is the problem. the > following code shows what have done. is there a way to make it right? Probably this will work: (defmacro def-site-entity [ent & body] `(let [e# (create-e)] (def ~ent (reify ~'clojure.lang

howto use reify in defmacro

2013-12-18 Thread Xiangtao Zhou
hi all, I want to use reify in macro, but the namespace is the problem. the following code shows what have done. is there a way to make it right? (defmacro def-site-entity [ent & body] `(let [e# (create-e)] (def ~ent (reify clojure.lang.ILookup (valAt [key not-found]

howto use reify in defmacro

2013-12-18 Thread Xiangtao Zhou
hi all, I want to use reify in macro, but the namespace is the problem. the following code shows what have done. is there a way to make it right? (defmacro def-site-entity [ent & body] `(let [e# (create-e)] (def ~ent (reify clojure.lang.ILookup (valAt [key not-found]