Clojure

make use of deprecated namespaces/vars easier to spot

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Critical Critical
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Patch:
    Code and Test
  • Approval:
    Prescreened

Description

From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces or vars without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

Proposed:

  • Add new *warn-on-deprecated* dynamic var, defaulted to false
  • Warn to stderr when {:deprecated true} namespace is loaded.
  • Warn to stderr when {:deprecated true} var is analyzed.
  • Warn to stderr when {:deprecated true} macro is expanded.
  • New system property clojure.compiler.warn-on-deprecated
  • Compile Clojure itself with clojure.compiler.warn-on-deprecated
  • Fix deprecation warnings inside Clojure (replicate, clear-agent-errors)
  • Mark clojure.parallel as deprecated with :deprecation tag

Examples:

(set! *warn-on-deprecated* true)

;; use of a deprecated var (on compile)
(defn ^:deprecated f [x] x)
(f 5)
;;=> Deprecation warning, NO_SOURCE_PATH:7:1 : var #'user/f is deprecated

;; use of a deprecated macro (on macro expansion)
(defmacro ^:deprecated m [x] x)
(m 5)
;;=> Deprecation warning, NO_SOURCE_PATH:7:1 : macro #'user/m is deprecated

;; use of a deprecated namespace (on load)
(ns foo {:deprecated "1.1"})
(ns bar (:require foo))
;;=> Deprecation warning: loading deprecated namespace `foo` from namespace `bar`

Patch: 706-deprecated-ns-var-warnings-tested-3.diff

Questions: Should default for deprecation warnings be true instead? People upgrading are likely to see new warnings which might be surprising.

  • Should default be to warn or not warn on deprecated?
  1. 706-deprecated-ns-var-warnings-tested.diff
    07/Mar/16 9:18 PM
    10 kB
    Cezary Kosko
  2. 706-deprecated-ns-var-warnings-tested-2.diff
    11/Mar/16 5:33 AM
    20 kB
    Cezary Kosko
  3. 706-deprecated-ns-var-warnings-tested-3.diff
    11/Mar/16 12:37 PM
    19 kB
    Cezary Kosko
  4. 706-deprecated-var-warning.diff
    26/Oct/12 1:37 PM
    6 kB
    Luke VanderHart
  5. 706-deprecated-var-warning-patch-v2.txt
    13/Feb/13 12:38 AM
    6 kB
    Andy Fingerhut
  6. 706-fix-deprecation-warnings-agents.diff
    26/Oct/12 1:37 PM
    1 kB
    Luke VanderHart
  7. 706-fix-deprecation-warnings-on-replicate.diff
    26/Oct/12 1:37 PM
    3 kB
    Luke VanderHart
  8. 706-fix-deprecation-warning-test-junit.diff
    26/Oct/12 1:37 PM
    3 kB
    Luke VanderHart
  9. 706-warning-on-deprecated-ns.diff
    29/Oct/12 1:02 AM
    0.9 kB
    Ghadi Shayban

Activity

Rich Hickey made changes -
Field Original Value New Value
Waiting On richhickey
Luke VanderHart made changes -
Luke VanderHart made changes -
Patch Code [ 10001 ]
Ghadi Shayban made changes -
Attachment 706-warning-on-deprecated-ns.diff [ 11638 ]
Andy Fingerhut made changes -
Alex Miller made changes -
Labels errormsgs
Alex Miller made changes -
Approval Triaged [ 10120 ]
Alex Miller made changes -
Priority Minor [ 4 ] Critical [ 2 ]
Alex Miller made changes -
Description From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

Some possibilities include:

# much more visible deprecation styling in the documentation
# stderr warnings when referencing a deprecated thing.

I don't love the idea of stderr warnings on all the time. Rich: is there an approach to this that you would like to see a patch for?
From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:* stderr warnings when referencing a deprecated thing (per Rich in comments)

Alex Miller made changes -
Description From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:* stderr warnings when referencing a deprecated thing (per Rich in comments)

From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:* stderr warnings when referencing a deprecated thing (per Rich in comments)

*Patch:* 706-deprecated-var-warning-patch-v2.txt
Andrew Rosa made changes -
Assignee Andrew Rosa [ andrewhr ]
Cezary Kosko made changes -
Alex Miller made changes -
Description From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:* stderr warnings when referencing a deprecated thing (per Rich in comments)

*Patch:* 706-deprecated-var-warning-patch-v2.txt
From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:* stderr warnings when referencing a deprecated thing (per Rich in comments)

*Patch:* 706-deprecated-ns-var-warnings-tested.diff
Alex Miller made changes -
Patch Code [ 10001 ] Code and Test [ 10002 ]
Description From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:* stderr warnings when referencing a deprecated thing (per Rich in comments)

*Patch:* 706-deprecated-ns-var-warnings-tested.diff
From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces or vars without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:*

* Add new {{*warn-on-deprecated*}} dynamic var, defaulted to false
* Warn to stderr when {{{:deprecated true}}} namespace is loaded.
* Warn to stderr when {{{:deprecated true}}} var is analyzed.
* Warn to stderr when {{{:deprecated true}}} macro is expanded.

*Patch:* 706-deprecated-ns-var-warnings-tested.diff

*Questions:* Should default for deprecation warnings be true instead? People upgrading are likely to see new warnings which might be surprising.

* Should default be to warn or not warn on deprecated?
Alex Miller made changes -
Description From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces or vars without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:*

* Add new {{*warn-on-deprecated*}} dynamic var, defaulted to false
* Warn to stderr when {{{:deprecated true}}} namespace is loaded.
* Warn to stderr when {{{:deprecated true}}} var is analyzed.
* Warn to stderr when {{{:deprecated true}}} macro is expanded.

*Patch:* 706-deprecated-ns-var-warnings-tested.diff

*Questions:* Should default for deprecation warnings be true instead? People upgrading are likely to see new warnings which might be surprising.

* Should default be to warn or not warn on deprecated?
From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces or vars without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:*

* Add new {{\*warn-on-deprecated*}} dynamic var, defaulted to false
* Warn to stderr when {{{:deprecated true}}} namespace is loaded.
* Warn to stderr when {{{:deprecated true}}} var is analyzed.
* Warn to stderr when {{{:deprecated true}}} macro is expanded.

*Patch:* 706-deprecated-ns-var-warnings-tested.diff

*Questions:* Should default for deprecation warnings be true instead? People upgrading are likely to see new warnings which might be surprising.

* Should default be to warn or not warn on deprecated?
Cezary Kosko made changes -
Cezary Kosko made changes -
Description From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces or vars without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:*

* Add new {{\*warn-on-deprecated*}} dynamic var, defaulted to false
* Warn to stderr when {{{:deprecated true}}} namespace is loaded.
* Warn to stderr when {{{:deprecated true}}} var is analyzed.
* Warn to stderr when {{{:deprecated true}}} macro is expanded.

*Patch:* 706-deprecated-ns-var-warnings-tested.diff

*Questions:* Should default for deprecation warnings be true instead? People upgrading are likely to see new warnings which might be surprising.

* Should default be to warn or not warn on deprecated?
From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces or vars without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:*

* Add new {{\*warn-on-deprecated*}} dynamic var, defaulted to false
* Warn to stderr when {{{:deprecated true}}} namespace is loaded.
* Warn to stderr when {{{:deprecated true}}} var is analyzed.
* Warn to stderr when {{{:deprecated true}}} macro is expanded.

*Patch:* 706-deprecated-ns-var-warnings-tested2.diff

*Questions:* Should default for deprecation warnings be true instead? People upgrading are likely to see new warnings which might be surprising.

* Should default be to warn or not warn on deprecated?
Assignee Andrew Rosa [ andrewhr ] Cezary Kosko [ cezarykosko ]
Cezary Kosko made changes -
Description From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces or vars without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:*

* Add new {{\*warn-on-deprecated*}} dynamic var, defaulted to false
* Warn to stderr when {{{:deprecated true}}} namespace is loaded.
* Warn to stderr when {{{:deprecated true}}} var is analyzed.
* Warn to stderr when {{{:deprecated true}}} macro is expanded.

*Patch:* 706-deprecated-ns-var-warnings-tested2.diff

*Questions:* Should default for deprecation warnings be true instead? People upgrading are likely to see new warnings which might be surprising.

* Should default be to warn or not warn on deprecated?
From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces or vars without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:*

* Add new {{\*warn-on-deprecated*}} dynamic var, defaulted to false
* Warn to stderr when {{{:deprecated true}}} namespace is loaded.
* Warn to stderr when {{{:deprecated true}}} var is analyzed.
* Warn to stderr when {{{:deprecated true}}} macro is expanded.

*Patch:* 706-deprecated-ns-var-warnings-tested-2.diff

*Questions:* Should default for deprecation warnings be true instead? People upgrading are likely to see new warnings which might be surprising.

* Should default be to warn or not warn on deprecated?
Alex Miller made changes -
Description From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces or vars without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:*

* Add new {{\*warn-on-deprecated*}} dynamic var, defaulted to false
* Warn to stderr when {{{:deprecated true}}} namespace is loaded.
* Warn to stderr when {{{:deprecated true}}} var is analyzed.
* Warn to stderr when {{{:deprecated true}}} macro is expanded.

*Patch:* 706-deprecated-ns-var-warnings-tested-2.diff

*Questions:* Should default for deprecation warnings be true instead? People upgrading are likely to see new warnings which might be surprising.

* Should default be to warn or not warn on deprecated?
From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces or vars without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:*

* Add new {{\*warn-on-deprecated*}} dynamic var, defaulted to false
* Warn to stderr when {{{:deprecated true}}} namespace is loaded.
* Warn to stderr when {{{:deprecated true}}} var is analyzed.
* Warn to stderr when {{{:deprecated true}}} macro is expanded.

Examples:

{code}
(set! *warn-on-deprecated* true)

;; use of a deprecated var (on compile)
(defn ^:deprecated f [x] x)
(f 5)
;;=> Deprecation warning, NO_SOURCE_PATH:7:1 : var #'bar/a is deprecated

;; use of a deprecated macro (on macro expansion)
(defmacro ^:deprecated a [x] x)
(a 5)
;;=> Deprecation warning, NO_SOURCE_PATH:7:1 : macro #'bar/a is deprecated

;; use of a deprecated namespace (on load)
(ns foo {:deprecated "1.1"})
(ns bar (:require foo))
;;=> Deprecation warning: loading deprecated namespace `foo` from namespace `bar`
{code}

*Patch:* 706-deprecated-ns-var-warnings-tested-2.diff

*Questions:* Should default for deprecation warnings be true instead? People upgrading are likely to see new warnings which might be surprising.

* Should default be to warn or not warn on deprecated?
Alex Miller made changes -
Description From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces or vars without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:*

* Add new {{\*warn-on-deprecated*}} dynamic var, defaulted to false
* Warn to stderr when {{{:deprecated true}}} namespace is loaded.
* Warn to stderr when {{{:deprecated true}}} var is analyzed.
* Warn to stderr when {{{:deprecated true}}} macro is expanded.

Examples:

{code}
(set! *warn-on-deprecated* true)

;; use of a deprecated var (on compile)
(defn ^:deprecated f [x] x)
(f 5)
;;=> Deprecation warning, NO_SOURCE_PATH:7:1 : var #'bar/a is deprecated

;; use of a deprecated macro (on macro expansion)
(defmacro ^:deprecated a [x] x)
(a 5)
;;=> Deprecation warning, NO_SOURCE_PATH:7:1 : macro #'bar/a is deprecated

;; use of a deprecated namespace (on load)
(ns foo {:deprecated "1.1"})
(ns bar (:require foo))
;;=> Deprecation warning: loading deprecated namespace `foo` from namespace `bar`
{code}

*Patch:* 706-deprecated-ns-var-warnings-tested-2.diff

*Questions:* Should default for deprecation warnings be true instead? People upgrading are likely to see new warnings which might be surprising.

* Should default be to warn or not warn on deprecated?
From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces or vars without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:*

* Add new {{\*warn-on-deprecated*}} dynamic var, defaulted to false
* Warn to stderr when {{{:deprecated true}}} namespace is loaded.
* Warn to stderr when {{{:deprecated true}}} var is analyzed.
* Warn to stderr when {{{:deprecated true}}} macro is expanded.

Examples:

{code}
(set! *warn-on-deprecated* true)

;; use of a deprecated var (on compile)
(defn ^:deprecated f [x] x)
(f 5)
;;=> Deprecation warning, NO_SOURCE_PATH:7:1 : var #'user/f is deprecated

;; use of a deprecated macro (on macro expansion)
(defmacro ^:deprecated m [x] x)
(m 5)
;;=> Deprecation warning, NO_SOURCE_PATH:7:1 : macro #'user/m is deprecated

;; use of a deprecated namespace (on load)
(ns foo {:deprecated "1.1"})
(ns bar (:require foo))
;;=> Deprecation warning: loading deprecated namespace `foo` from namespace `bar`
{code}

*Patch:* 706-deprecated-ns-var-warnings-tested-2.diff

*Questions:* Should default for deprecation warnings be true instead? People upgrading are likely to see new warnings which might be surprising.

* Should default be to warn or not warn on deprecated?
Alex Miller made changes -
Description From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces or vars without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:*

* Add new {{\*warn-on-deprecated*}} dynamic var, defaulted to false
* Warn to stderr when {{{:deprecated true}}} namespace is loaded.
* Warn to stderr when {{{:deprecated true}}} var is analyzed.
* Warn to stderr when {{{:deprecated true}}} macro is expanded.

Examples:

{code}
(set! *warn-on-deprecated* true)

;; use of a deprecated var (on compile)
(defn ^:deprecated f [x] x)
(f 5)
;;=> Deprecation warning, NO_SOURCE_PATH:7:1 : var #'user/f is deprecated

;; use of a deprecated macro (on macro expansion)
(defmacro ^:deprecated m [x] x)
(m 5)
;;=> Deprecation warning, NO_SOURCE_PATH:7:1 : macro #'user/m is deprecated

;; use of a deprecated namespace (on load)
(ns foo {:deprecated "1.1"})
(ns bar (:require foo))
;;=> Deprecation warning: loading deprecated namespace `foo` from namespace `bar`
{code}

*Patch:* 706-deprecated-ns-var-warnings-tested-2.diff

*Questions:* Should default for deprecation warnings be true instead? People upgrading are likely to see new warnings which might be surprising.

* Should default be to warn or not warn on deprecated?
From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces or vars without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:*

* Add new {{\*warn-on-deprecated*}} dynamic var, defaulted to false
* Warn to stderr when {{{:deprecated true}}} namespace is loaded.
* Warn to stderr when {{{:deprecated true}}} var is analyzed.
* Warn to stderr when {{{:deprecated true}}} macro is expanded.
* New system property clojure.compiler.warn-on-deprecated
* Compile Clojure itself with clojure.compiler.warn-on-deprecated
* Fix deprecation warnings inside Clojure (replicate, clear-agent-errors)
* Mark clojure.parallel as deprecated with :deprecation tag

Examples:

{code}
(set! *warn-on-deprecated* true)

;; use of a deprecated var (on compile)
(defn ^:deprecated f [x] x)
(f 5)
;;=> Deprecation warning, NO_SOURCE_PATH:7:1 : var #'user/f is deprecated

;; use of a deprecated macro (on macro expansion)
(defmacro ^:deprecated m [x] x)
(m 5)
;;=> Deprecation warning, NO_SOURCE_PATH:7:1 : macro #'user/m is deprecated

;; use of a deprecated namespace (on load)
(ns foo {:deprecated "1.1"})
(ns bar (:require foo))
;;=> Deprecation warning: loading deprecated namespace `foo` from namespace `bar`
{code}

*Patch:* 706-deprecated-ns-var-warnings-tested-2.diff

*Questions:* Should default for deprecation warnings be true instead? People upgrading are likely to see new warnings which might be surprising.

* Should default be to warn or not warn on deprecated?
Cezary Kosko made changes -
Cezary Kosko made changes -
Description From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces or vars without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:*

* Add new {{\*warn-on-deprecated*}} dynamic var, defaulted to false
* Warn to stderr when {{{:deprecated true}}} namespace is loaded.
* Warn to stderr when {{{:deprecated true}}} var is analyzed.
* Warn to stderr when {{{:deprecated true}}} macro is expanded.
* New system property clojure.compiler.warn-on-deprecated
* Compile Clojure itself with clojure.compiler.warn-on-deprecated
* Fix deprecation warnings inside Clojure (replicate, clear-agent-errors)
* Mark clojure.parallel as deprecated with :deprecation tag

Examples:

{code}
(set! *warn-on-deprecated* true)

;; use of a deprecated var (on compile)
(defn ^:deprecated f [x] x)
(f 5)
;;=> Deprecation warning, NO_SOURCE_PATH:7:1 : var #'user/f is deprecated

;; use of a deprecated macro (on macro expansion)
(defmacro ^:deprecated m [x] x)
(m 5)
;;=> Deprecation warning, NO_SOURCE_PATH:7:1 : macro #'user/m is deprecated

;; use of a deprecated namespace (on load)
(ns foo {:deprecated "1.1"})
(ns bar (:require foo))
;;=> Deprecation warning: loading deprecated namespace `foo` from namespace `bar`
{code}

*Patch:* 706-deprecated-ns-var-warnings-tested-2.diff

*Questions:* Should default for deprecation warnings be true instead? People upgrading are likely to see new warnings which might be surprising.

* Should default be to warn or not warn on deprecated?
From the mailing list http://groups.google.com/group/clojure/msg/c41d909bd58e4534. It is easy to use deprecated namespaces or vars without knowing you are doing so. The documentation warnings are small, and there is no compiler warning.

*Proposed:*

* Add new {{\*warn-on-deprecated*}} dynamic var, defaulted to false
* Warn to stderr when {{{:deprecated true}}} namespace is loaded.
* Warn to stderr when {{{:deprecated true}}} var is analyzed.
* Warn to stderr when {{{:deprecated true}}} macro is expanded.
* New system property clojure.compiler.warn-on-deprecated
* Compile Clojure itself with clojure.compiler.warn-on-deprecated
* Fix deprecation warnings inside Clojure (replicate, clear-agent-errors)
* Mark clojure.parallel as deprecated with :deprecation tag

Examples:

{code}
(set! *warn-on-deprecated* true)

;; use of a deprecated var (on compile)
(defn ^:deprecated f [x] x)
(f 5)
;;=> Deprecation warning, NO_SOURCE_PATH:7:1 : var #'user/f is deprecated

;; use of a deprecated macro (on macro expansion)
(defmacro ^:deprecated m [x] x)
(m 5)
;;=> Deprecation warning, NO_SOURCE_PATH:7:1 : macro #'user/m is deprecated

;; use of a deprecated namespace (on load)
(ns foo {:deprecated "1.1"})
(ns bar (:require foo))
;;=> Deprecation warning: loading deprecated namespace `foo` from namespace `bar`
{code}

*Patch:* 706-deprecated-ns-var-warnings-tested-3.diff

*Questions:* Should default for deprecation warnings be true instead? People upgrading are likely to see new warnings which might be surprising.

* Should default be to warn or not warn on deprecated?
Alex Miller made changes -
Approval Triaged [ 10120 ] Prescreened [ 10220 ]

People

Vote (19)
Watch (9)

Dates

  • Created:
    Updated: