News for hackers. Stuff that matters.
Re:Clojure from the Ground Up, Part 2: Basic Types by diego on Sunday October 27, 2013 @02:30PM (#6622869)
Useful tip:

"By default Clojure operates with natural numbers as instances of Java's long primitive type. When a primitive integer operation results in a value that too large to be contained in a primitive value, a java.lang.ArithmeticException is thrown. Clojure provides a set of alternative math operators suffixed with an apostrophe: +', -', *', inc', and dec'. These operators auto-promote to BigInt upon overflow, but are less efficient than the regular math operators."

So you can write

(inc' Long/MAX_VALUE)

instead of

(inc (bigint Long/MAX_VALUE))

There are no comments on this comment yet.