Clojure

Make boxed math warning suppressible

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: Release 1.7
  • Fix Version/s: Release 1.7
  • Component/s: None
  • Labels:
  • Patch:
    Code and Test
  • Approval:
    Ok

Description

Clojure 1.7.0-alpha2 included a new warning that will notify on use of boxed math when unchecked-math is set to true (CLJ-1325). Based on feedback, would like to make these warnings optional.

Approach: Revert (set! *unchecked-math* true) to prior behavior. Only emit warnings when (set! *unchecked-math* :warn-on-boxed).

Patch: clj-1535-3.patch

Screened by: Stuart Halloway

  1. clj-1535.patch
    06/Oct/14 4:31 PM
    4 kB
    Alex Miller
  2. clj-1535-2.patch
    06/Oct/14 7:44 PM
    5 kB
    Stuart Halloway
  3. clj-1535-3.patch
    07/Oct/14 8:12 AM
    4 kB
    Alex Miller
  4. silence-boxed-patch-10-01-2014.patch
    01/Oct/14 7:46 PM
    4 kB
    Michael Blume

Activity

Hide
Michael Blume added a comment -

So I decided to take a shot at writing a patch for this. This is my first Clojure core patch, so I've probably messed up some formatting, but the implementation was pretty simple and the tests pass.

I introduced a variable, clojure.core/silence-boxed which defaults false and, when true, silences boxed math warnings. If the reverse is preferred (warn-boxed or similar) I can do that too.

Show
Michael Blume added a comment - So I decided to take a shot at writing a patch for this. This is my first Clojure core patch, so I've probably messed up some formatting, but the implementation was pretty simple and the tests pass. I introduced a variable, clojure.core/silence-boxed which defaults false and, when true, silences boxed math warnings. If the reverse is preferred (warn-boxed or similar) I can do that too.
Hide
Alex Miller added a comment -

Hi Michael, we have other plans for how this should be implemented, so will likely not use your patch. In the future, it's always good to check if the ticket is already assigned to someone before working on it.

Show
Alex Miller added a comment - Hi Michael, we have other plans for how this should be implemented, so will likely not use your patch. In the future, it's always good to check if the ticket is already assigned to someone before working on it.
Hide
Alex Miller added a comment -

Added clj-1535-3.patch, which is exactly the same diff as clj-1535-2.patch, but just squashes into a single commit.

Show
Alex Miller added a comment - Added clj-1535-3.patch, which is exactly the same diff as clj-1535-2.patch, but just squashes into a single commit.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: