Skip to content
/ frinj Public
forked from martintrojer/frinj

Practical unit-of-measure calculator DSL for Clojure / ClojureScript

Notifications You must be signed in to change notification settings

sdave2/frinj

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frinj

Frinj is a practical unit-of-measure calculator DSL for Clojure / ClojureScript.

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

Usage

Add the following line into your Leiningen :dependencies [frinj "0.2.5"].

Clojure

user=> (use 'frinj.repl)
user=> (frinj-init!)
user=> (override-operators!)
user=> (fj 2000 :Calories :per :day :to :watts)
;; "1163/12 (approx. 96.91666666666667) [dimensionless]"

ClojureScript

There are a few differences when running Frinj on Node / in a browser. See this wiki page for details.

Examples

Finally, check out the wiki from more info.

License

Copyright (C) 2013 Martin Trojer

Distributed under the Eclipse Public License, the same as Clojure.

About

Practical unit-of-measure calculator DSL for Clojure / ClojureScript

Resources

Stars

Watchers

Forks

Packages

No packages published