Make boxed math warning suppressible

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

Environment

None

Attachments

4
  • 07 Oct 2014, 02:12 PM
  • 07 Oct 2014, 01:44 AM
  • 06 Oct 2014, 10:31 PM
  • 02 Oct 2014, 01:46 AM

Activity

Show:

Alex Miller October 7, 2014 at 2:12 PM

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

Alex Miller October 2, 2014 at 2:34 AM

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.

Michael Blume October 2, 2014 at 1:45 AM

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.

Completed

Details

Assignee

Reporter

Labels

Approval

Ok

Patch

Code and Test

Priority

Affects versions

Fix versions

Created September 26, 2014 at 1:59 PM
Updated October 7, 2014 at 6:32 PM
Resolved October 7, 2014 at 6:32 PM