Executing the rationals kata as proposed by @trikitrok at the Scala Bcn Meetup but in clojure
Description: https://gist.github.com/trikitrok/0652d91c85cd5a5305c4
(local copy below)
We'll program the addition of two rationals using TDD.
Suggested API for the method (in Java):
public Rational add(Rational rational);
Constraints:
- Rationals must be immutable after creation.
- They have to be stored in reduced form, e.g., 2/4 would be stored as 1/2, check greatest common divisor computation
go to project.clj, control+space (in mac), choose instarepl, wait for to finish connecting. It might fail go to test/*clj and command+enter to execute expressions / facts