开发者

What are the breaking changes in clojure 1.3?

开发者 https://www.devze.com 2023-01-22 21:06 出处:网络
I have been having trouble keeping up with the list of changes in 1.3 and most importantly th开发者_开发问答e changes that require me to change my code.

I have been having trouble keeping up with the list of changes in 1.3 and most importantly th开发者_开发问答e changes that require me to change my code.

  • What has changed,
  • what is about to change,
  • where can I get up to date lists of these?


Breaking changes to date:

  • Math ops no longer promote into bignums.

  • Math ops no longer narrow the result to the smallest type that can hold them.

  • Vars will no longer default to being dynamically bindable. Add ^:dynamic when needed.


A couple of other numerical changes:

  • There is a new literal for BigIntegers: 5N, which is 5 as a BigInteger.
  • The rules for equality have changed (perhaps arising as a result of the changes Alex mentions?):
    • (= 2 2.0) => false, but (== 2 2.0) => true
    • (= 2 2M) => false, but (== 2 2M) => true
    • (= 2.0 2M) => false, but (== 2.0 2M) => true
    • and for clarity:
      • (= 2 2N) => true
      • (= 2 4/2) => true
    • You can generally assume that you'll need == to compare floating-point numbers for equality (which is still probably a shaky proposition).
0

精彩评论

暂无评论...
验证码 换一张
取 消