Automatically generate Clojure function proxies for java.lang.Math static methods.
Clojure
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.gitignore
.travis.yml
README.md
project.clj

README.md

mathemagician

Automatically generate Clojure function proxies for java.lang.Math static methods.

Build Status

Usage

Add this to your project.clj if you're using Leiningen:

[alandipert/mathemagician "0.0.2"]

Then, in the namespace you want math functions in:

(ns your-ns
  (:use [mathemagician :only (abs)]))

(abs -3) ;=> 3

Performance

Effort has been made to make the functions that mathemagician generates fast, but they're still about 5x slower than direct calls to Math methods.

If you need better performance, you can substitute your mathemagician function calls for Math method calls.

Thanks

Thanks to Patrick Brown for the idea, Jon Distad for pairing with me on the initial implementation, and to the Durham Clojure Roadshow class for their participation.

License

Copyright (C) 2012 Alan Dipert

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