Clojure private const vars? -


new clojure , i'm wondering.. can define var both ^:private , ^:const?

so instance, make sense following:

(def ^:private ^:const 42) 

yes, on sufficiently modern clojure version.

long ago metadata keywords didn't "roll up" fixed years ago.

the ^:keyword reader-macro syntactic shorthand ^{:keyword true}

user> (def ^:private ^:const 42) #'user/everything user> (meta #'everything) {:const true, :private true, :line 241457, :column 7, :file "*cider-repl api*", :name everything, :ns #namespace[user]} 

is same as:

user> (def ^{:private true :const true} 42) #'user/everything user> (meta #'everything) {:private true, :const true, :line 241816, :column 7, :file "*cider-repl api*", :name everything, :ns #namespace[user]} 

Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -