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

Activity

Show:
Alex Miller
October 7, 2014, 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, 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, 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
Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Unassigned

Reporter

Alex Miller

Labels

Approval

Ok

Patch

Code and Test

Priority

Major

Affects versions

Fix versions