File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1893,6 +1893,35 @@ composability.
1893
1893
1894
1894
Prefer syntax-quoted forms over building lists manually.
1895
1895
1896
+ == Common Metadata
1897
+
1898
+ In this section we'll go over some common metadata for namespaces and
1899
+ vars that Clojure development tools can leverage.
1900
+
1901
+ === `:deprecated`
1902
+
1903
+ The most common way to mark deprecated public APIs is via the `:deprecated`
1904
+ metadata. Normally you'd use as the value the version in which something
1905
+ was deprecated in case of versioned software (e.g. a library) or simply
1906
+ `true` in the case of unversioned software (e.g. some web application).
1907
+
1908
+ [source,clojure]
1909
+ ----
1910
+ (def ^{:deprecated "0.5"} foo
1911
+ "Use `bar` instead.
1912
+ 42)
1913
+
1914
+ (ns foo.bar
1915
+ "A deprecated ns."
1916
+ {:deprecated "0.8"})
1917
+
1918
+ (defn ^{:deprecated "0.5"} foo
1919
+ (bar))
1920
+ ----
1921
+
1922
+ TIP: If you're into SemVer, it's a good idea to omit the patch version.
1923
+ This means you should use `0.5` instead of `0.5.0`.
1924
+
1896
1925
== Comments
1897
1926
1898
1927
[quote, Steve McConnell]
You can’t perform that action at this time.
0 commit comments