plumatic / dommy

A tiny ClojureScript DOM manipulation and event library
759 stars 74 forks source link

defnode macro #24

Closed dubiousdavid closed 11 years ago

dubiousdavid commented 11 years ago

Can you please add the following macro.

(defmacro defnode [name data]
  `(def ~name
     (node ~data)))
aria42 commented 11 years ago

There doesn't seem like much value add to me. Macros need to add a lot of value in order to be worthwhile.

dubiousdavid commented 11 years ago

I use this all the time when composing sub-templates. Is there a downside to adding it?

On Apr 2, 2013, at 1:19 PM, Aria Haghighi notifications@github.com wrote:

There doesn't seem like much value add to me. Macros need to add a lot of value in order to be worthwhile.

— Reply to this email directly or view it on GitHub.

aria42 commented 11 years ago

Can I see a concrete example of use? I think you're better off just def-ing the data and at the point at which stuff gets made into dom you can can compose the data. If you show me an example, I think there's a better way to do what you're trying to do using existing parts of the library.

dubiousdavid commented 11 years ago

I see what you're saying. I'll try that approach, and see how it works for me.

On Apr 2, 2013, at 1:54 PM, Aria Haghighi notifications@github.com wrote:

Can I see a concrete example of use? I think you're better off just def-ing the data and at the point at which stuff gets made into dom you can can compose the data. If you show me an example, I think there's a better way to do what you're trying to do using existing parts of the library.

— Reply to this email directly or view it on GitHub.

aria42 commented 11 years ago

Ok I'm closing this. I don't think there's a good use of this macro.

dubiousdavid commented 11 years ago

I still could totally use this, especially for testing purposes. I can't figure out why you wouldn't want to include, since it's very simple and there are use cases.

aiba commented 11 years ago

I have to agree with @aria42 that this macro does not seem to provide much value. And a concrete example of use was never provided. Also, it would be easy to add this macro to your own project's source code without modifying dommy.

dubiousdavid commented 11 years ago

No worries. I spent the day writing my own templating library. There were too many little things that I wanted/needed that weren't there (e.g., [[:div][:div]]). Thanks for the awesome project and the inspiration.

On Apr 11, 2013, at 8:12 PM, Aaron Iba notifications@github.com wrote:

I have to agree with @aria42 that this macro does not seem to provide much value. And a concrete example of use was never provided. Also, it would be easy to add this macro to your own project's source code without modifying dommy.

— Reply to this email directly or view it on GitHub.