generic functions: more restricted but faster than Clojure multimethods
APACHE-2.0 License
This library is currently a vehicle for experimenting with design and implementation alternatives for generic functions (aka multimethods) in Clojure. It is therefore completely unstable (I'm committed to nothing for now) until at least version 0.1.0.
Initial ideas:
defn
(defn compose ^IFn [^IFn f ^IFn g]
(assert (matches? (arglist f) (return-value g))
(function (str (name f) "-o-" (name g)) (arglist g)
`(f (g ~(arglist g)))))
It should be possible to examine the returned function object,f
and g
, andAvailable from Clojars:
Maven:
<dependency>
<groupId>palisades-lakes</groupId>
<artifactId>dynamic-functions</artifactId>
<version>0.0.x</version>
</dependency>
Leiningen/Boot:
Leiningen/Boot
[palisades-lakes/dynamic-functions "0.0.x"]
(require `[palisades.lakes.dynafn.api :as df])
(df/defn intersects? [^IntegerInterval s0 ^java.util.Set s1] (.intersects s0 s1))
YourKit is kindly supporting open source projects with its full-featured Java Profiler.
YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look at YourKit's leading software products: