The syntax quote “lets you put things inside it” with ~ (“insert one element”) and ~@ (“insert many elements”)
Second, metadata.
;; When you define Clojure var, metadata is attached.
(def g
"gravitational accelleration in m/s2"
9.81)
;; If we just evaluate g and ask for meta, we get nothing, since we evaluated.
(meta g)
;; => nil
;; If we ask for the "reference to g", we'll get the metadata
(meta #'g)
;; => {:line 7,
;; :column 1,
;; :file
;; "/home/teodorlu/sandbox/clojure/scratch/src/th/scratch/rnd_2020_04_30.clj",
;; :doc "gravitational accelleration in m/s2",
;; :name g,
;; :ns #namespace[th.scratch.rnd-2020-04-30]}
tks u for your explanation, after doing further research from here, i came to understand that this also preserve form metadata. by saying preserve, could you pls tell me more about metadata use cases?
Metadata is attached to objects supporting it, but in Clojure, since you don’t mutate arguments, you often return a modified new object from an existing one. The new modified object will have the metadata from the original one only if the macro or function you used to modify it preserves metadata. That means that it copies over the metadata from the original object to the returned one.