Frinj is a practical unit-of-measure calculator DSL for Clojure.
Key features;
- Tracks units of measure through all calculations allowing you to mix units of measure transparently
- Comes with a huge database of units and conversion factors
- Supports live unit feeds like currency conversion
- Inspired by the Frink project (http://futureboy.us/frinkdocs/)
- Tries to combine Frink's fluent calculation style with idiomatic Clojure
- Supports infix calculation style
Using Leiningen, create a new project
$ lein new frinj-example
Add the following line to the dependency list in frinj-example/project.clj
:
(defproject frinj-example "1.0"
:dependencies [[org.clojure/clojure "1.4.0"]
[frinj "0.1.4"]])
Pull the dependencies and start the REPL
$ cd frinj-example
$ lein deps
$ lein repl
Reference and initialize the Frinj calculator
user=> (use 'frinj.repl)
Start calculating!
-
See example calculations for ideas...
-
Examples using infix calcuation style here
-
Live units for currencies, precious metals etc, see simple examples
Finally, check out the wiki from more info.
Copyright (C) 2013 Martin Trojer
Distributed under the Eclipse Public License, the same as Clojure.