Is it possible to use macros within ClojureScript without having to
fully reference them?
Right now I have
(ns hack.cljs.hello
(:require-macros [d3-macros :as d3m]))
and have to use the form
(d3m/my-macro ...)
Ideally I could just say
(my-macro ...)
Is this possible?
Bonus question: the macro I want to use is for "extending" a native js
library that uses jQuery-style chained calls.
In particular, my macro expands a map into individual function calls
so that instead of
obj.attr("a", 1)
.attr("b", 2)
I can write in ClojureScript
(-> obj
(.attr {"a" 1 "b" 2}))
So, the bonus question is: can I import a macro with a "." prefix so
all of the magic is behind the scenes and I don't have to think about
whether I need to use
(.attr obj "a" 1) or (my-attr obj {"a" 1 "b" 2})
--
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