Last active
December 20, 2015 09:09
-
-
Save fogus/6106189 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns depr.core) | |
(defn ^:private !! [c] | |
(println "WARNING - Deprecation of " c " in effect.")) | |
(defmacro defn-deprecated | |
[nom _ alt ds & arities] | |
(let [silence? (:silence-deprecations (meta clojure.core/*ns*))] | |
(when-not silence? | |
(!! alt))) | |
`(defn ~nom ~ds ~@arities)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ^:silence-deprecations depr.core-test | |
(:use clojure.test) | |
(:require [depr.core :refer (defn-deprecated)])) | |
(defn-deprecated foo :as quux | |
"Does something" | |
[] | |
42) | |
(deftest a-test | |
(testing "Nothing really" | |
(is (= 42 (foo))))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment