Skip to content

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

Notifications You must be signed in to change notification settings

alandipert/mathemagician

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published