Skip to content

Commit f03cc3e

Browse files
committed
[#181] Document :superseded-by
1 parent d9497cf commit f03cc3e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.adoc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,6 +1928,37 @@ TIP: If you're into SemVer, it's a good idea to omit the patch version.
19281928
This means you should use `0.5` instead of `0.5.0`. This applies
19291929
for all metadata data that's version related.
19301930

1931+
=== `:superseded-by`
1932+
1933+
Often you'd combine `:deprecated` with `:superseded-by`, as there would be
1934+
some newer API that supersedes whatever got deprecated.
1935+
1936+
Typically for vars you'll use a non-qualified name if the replacement lives
1937+
in the same namespace, and a fully-qualified name otherwise.
1938+
1939+
[source,clojure]
1940+
----
1941+
;; in case we have a version
1942+
(def ^{:deprecated "0.5"
1943+
:superseded-by "bar"} foo
1944+
"Use `bar` instead.
1945+
42)
1946+
1947+
(ns foo.bar
1948+
"A deprecated ns."
1949+
{:deprecated "0.8"
1950+
:superseded-by "foo.baz"})
1951+
1952+
(defn ^{:deprecated "0.5"
1953+
:superseded-by "bar"} foo
1954+
(bar))
1955+
1956+
;; otherwise
1957+
(defn ^{:deprecated true
1958+
:superseded-by "bar"} foo
1959+
(bar))
1960+
----
1961+
19311962
=== `:added`
19321963

19331964
The most common way to document when a public API was added to a

0 commit comments

Comments
 (0)