I was hoping that ^:const would be able to inline any symbol value and that
it would do so before macroexpanssion so that:
(def ^:const bar {:a 100})
(defmacro foo
[x]
(:a x))
(foo bar)
Would return:
100
The same way that:
(foo {:a 100})
does.
Then I read that ^:const only inlines primitive values (which disappointed
me), but so I thought that this would work:
(def ^:const bar 100)
(defmacro foo
[x]
(+ 10 x))
(foo bar)
but that also doesn't work.
So now I believe that ^:const inlines after macroexpanssion.
I feel it would be really cool to be able to factor some input to macros
into constants, is this something I could open a ticket for, to extend
^:const so it can inline all literal values and also does the inlining
before macroexpanssion so that the above would work?
--
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
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.