non/spire — pull request #134 by tixxit (2013-08-08 19:58:20+00:00)
Title: Add checked Int/Long arithmetic macro

This adds 2 new macros: `Checked.checked { ... }` and `Checked.option { ... }`. All uses of `+`, `-`, `*`, `/`, and `unary_-` in the expression inside of the block will be transformed into checked versions of the ops - they will throw `ArithmeticException`s on overflow.

In the case of `Checked.option { ... }`, the exception is caught and a Some/None is returned instead.