Skip to content

clojure.core/memfn

View this page on ClojureDocs

Type: macro Added: Clojure 1.0 Examples: 3 Runnable: 0
([name & args])

Expands into code that creates a fn that expects to be passed an object and any args and calls the named instance method on the object passing the args. Use when you want to treat a Java method as a first-class fn. name may be type-hinted with the method receiver's type in order to avoid reflective calls.

Examples

by nipra on . May have evaluation errors.
by emidln on . May have evaluation errors.
by reborg on . May have evaluation errors.

Content from the matching ClojureDocs page, with authors credited on each contribution.