Only compile time metadata is possible for ClojureScript vars now. And that's
perfectly fine.
What would be cool is to be able to add arbitrary keys to it. That'd still be
immutable metadata only added at compile time. Unfortunately, it's ignored now:
ClojureScript:cljs.user>
(defn expect-string
"Throws AssError for non-strings!"
{:expectation true}
[x]
(assert (string? x)))
#<function expect_string(x){
// ... generated JS
}>
ClojureScript:cljs.user> (meta #'expect-string)
{:arglists ([x]), :test nil, :name expect-string, :column 1, :line 3, :file
"<cljs repl>", :doc "Throws AssError for non-strings!", :ns cljs.user}
;; :expectation key is lost
What do you think?
--
Note that posts from new members are moderated - please be patient with your
first post.
---
You received this message because you are subscribed to the Google Groups
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.