<< Back to previous view

[CLJ-767] Remove support for non-primitive bit-shift operations Created: 04/Apr/11  Updated: 25/May/11  Resolved: 25/May/11

Status: Closed
Project: Clojure
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Alexander Taggart Assignee: Unassigned
Resolution: Declined Votes: 0
Labels: None


Per Rich's comment:

Shift ops would be limited to primitives only. Default versions 64-bit, but explicit shift-int versions for 32 bits.

Comment by Alexander Taggart [ 05/Apr/11 4:23 PM ]

Rather than changing the behaviour of the extant unchecked ops (see the original discussion), I've created three new namespaces:

  • clojure.unchecked: Contains unchecked versions of the primitive cast functions. Removed the unchecked-prim cast functions that were added to core recently.
  • clojure.unchecked.long: Contains unchecked, long-arg versions of the numeric and bit-op functions from core.
  • clojure.unchecked.double: Contains unchecked, double-arg versions of the numeric functions from core.
Comment by Alexander Taggart [ 06/Apr/11 1:23 PM ]

Note that the clojure.unchecked namespace idea was first proffered by Rich in the comments on CLJ-441.

Comment by Rich Hickey [ 07/Apr/11 8:25 AM ]

This does way too much, and thus makes it hard to talk about.

Moving unchecked coercions into unchecked ns is ok, and would make a fine and acceptably-sized patch.

unchecked double makes no sense to me at all - no double ops are checked

There seems to be general confusion about unchecked vs primitive-taking. Only a small subset of ops have the overflow checking that is turned off by 'unchecked'

There's no sense in which the interacts with *unchecked-math*, nor with the latest numerics approach (primitive semantics by default)

There's a ton of duplication with things already in Numbers that handle primitive overloads. esp. in combination with different primitives and objects.

The things we need for bit ops are lost in the noise.

What I want for bit ops is the same thing we currently (in latest) have for other ops - primitive semantics by default, no conditionals, direct mapping to JVM primitive ops.

And separate tickets and patches for each step, please. This is simply too much to consider.



Comment by Alexander Taggart [ 07/Apr/11 8:11 PM ]

Patch removes support for non-primitive args to bit-shift operations.

Comment by Alexander Taggart [ 25/May/11 12:12 PM ]

Was effectively replaced by CLJ-772.

Generated at Sun Jan 21 23:00:00 CST 2018 using JIRA 4.4#649-r158309.