Clojure

Add unchecked coercions

Details

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

Description

Checking in coercions has been added, making them safe, but removing the bit-twiddling power. We need some unchecked (truncating) coercion ops

Activity

Hide
Assembla Importer added a comment -

richhickey said: See also #284 which will be addressed by this

Show
Assembla Importer added a comment - richhickey said: See also #284 which will be addressed by this
Hide
Assembla Importer added a comment -

ataggart said: [file:dVK0q-Znmr37hgeJe5cbLA]: implementation and tests for unchecked casts

Show
Assembla Importer added a comment - ataggart said: [file:dVK0q-Znmr37hgeJe5cbLA]: implementation and tests for unchecked casts
Hide
Assembla Importer added a comment -

ataggart said: Added unchecked casts from every numeric primitive and Object to every numeric primitive. Character and char can only get cast to int, as per the convention with the checked cast.

Added tests for the above in clojure.test-clojure.numbers.

Show
Assembla Importer added a comment - ataggart said: Added unchecked casts from every numeric primitive and Object to every numeric primitive. Character and char can only get cast to int, as per the convention with the checked cast. Added tests for the above in clojure.test-clojure.numbers.
Hide
Assembla Importer added a comment -

ataggart said: [file:alGr58Znur34SreJe5cbCb]: Same as above but without the typo in the docs

Show
Assembla Importer added a comment - ataggart said: [file:alGr58Znur34SreJe5cbCb]: Same as above but without the typo in the docs
Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - stu said: [file:c1gyXG1xKr37lweJe5cbLr]
Hide
Assembla Importer added a comment -

stu said: Third patch subsumes previous two and adds a test table for various conversions.

Show
Assembla Importer added a comment - stu said: Third patch subsumes previous two and adds a test table for various conversions.
Hide
Assembla Importer added a comment -

richhickey said: I'd be interested in better names than unchecked-*

any ideas? Think also about unchecked-add et al

Show
Assembla Importer added a comment - richhickey said: I'd be interested in better names than unchecked-* any ideas? Think also about unchecked-add et al
Hide
Assembla Importer added a comment -

richhickey said: let's create a clojure.unchecked ns and put these and the other unchecked arithmetic ops in there, using same names as normal, e.g. , inc etc. Only put the long versions in there, we'll have to decide separately about the truncating int-add etc. Then people can either use unchecked or alias and do uc/ etc

Show
Assembla Importer added a comment - richhickey said: let's create a clojure.unchecked ns and put these and the other unchecked arithmetic ops in there, using same names as normal, e.g. , inc etc. Only put the long versions in there, we'll have to decide separately about the truncating int-add etc. Then people can either use unchecked or alias and do uc/ etc
Hide
Rich Hickey added a comment - - edited

Let's create a clojure.unchecked ns and put these and the other unchecked arithmetic ops in there, using same names as normal, e.g. +, inc etc. Only put the -long versions in there, we'll have to decide separately about the truncating int-add etc. Then people can either use unchecked or alias and do uc/+ etc

Show
Rich Hickey added a comment - - edited Let's create a clojure.unchecked ns and put these and the other unchecked arithmetic ops in there, using same names as normal, e.g. +, inc etc. Only put the -long versions in there, we'll have to decide separately about the truncating int-add etc. Then people can either use unchecked or alias and do uc/+ etc
Rich Hickey made changes -
Field Original Value New Value
Assignee Rich Hickey [ richhickey ]
Hide
Rich Hickey added a comment -

error: patch failed: test/clojure/test_clojure/numbers.clj:31

Show
Rich Hickey added a comment - error: patch failed: test/clojure/test_clojure/numbers.clj:31
Rich Hickey made changes -
Assignee Rich Hickey [ richhickey ] Stuart Halloway [ stu ]
Reporter Assembla Importer [ importer ]
Priority Blocker [ 1 ]
Aaron Bedra made changes -
Assignee Stuart Halloway [ stu ] Aaron Bedra [ aaron ]
Aaron Bedra made changes -
Attachment 0441-unchecked-coercions.patch [ 10028 ]
Approval Test Screened
Patch Code and Test
Hide
Aaron Bedra added a comment -

Fixed up the patch to merge properly as of 8225407032ea643cbe3db7f35ef97b1230fc65b8

Show
Aaron Bedra added a comment - Fixed up the patch to merge properly as of 8225407032ea643cbe3db7f35ef97b1230fc65b8
Rich Hickey made changes -
Assignee Aaron Bedra [ aaron ] Rich Hickey [ richhickey ]
Rich Hickey made changes -
Status In Progress [ 3 ] Resolved [ 5 ]
Approval Screened Ok
Resolution Completed [ 1 ]
Stuart Halloway made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: