Clojure

Suppress warnings when clojure.core symbols are explicitly replaced with "use" or "refer"

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: Release 1.5
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Patch:
    Code

Description

Problem: Libraries that provide DSLs (such as core.matrix) often replace or extend functions in core (such as "+", "==", "zero?"), since it is desirable to use the best / most idiomatic names.

Currently importing such libraries with "use" causes unwanted warnings like "WARNING: + already refers to: #'clojure.core/+ in namespace: test.blank, being replaced by: #'clojure.core.matrix/+".

Avoiding these warnings requires extra user effort and boilerplate code, which is frustrating for users since they have already explicitly asked for the full library to be imported into the current namespace (i.e. via "use" or ":refer :all").

Proposed solution is to introduce a new var warn-on-replace similar to warn-on-reflection which allows this warning to be controlled.

  1. clj-1257.diff
    06/Sep/13 10:38 PM
    4 kB
    Mike Anderson
  2. clj-1257-2.diff
    08/Sep/13 1:46 AM
    8 kB
    Mike Anderson

Activity

Mike Anderson made changes -
Field Original Value New Value
Attachment clj-1257.diff [ 12245 ]
Andy Fingerhut made changes -
Patch Code [ 10001 ]
Mike Anderson made changes -
Attachment clj-1257-2.diff [ 12247 ]
Alex Miller made changes -
Labels namespace
Issue Type Defect [ 1 ] Enhancement [ 4 ]
Summary Suppress warnings when clojure.core symbols are explicitly replaces with "use" or "refer" Suppress warnings when clojure.core symbols are explicitly replaced with "use" or "refer"

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: