API for import-static - clojure-contrib v1.1 (stable)

by Stuart Sierra

Full namespace name: clojure.contrib.import-static

Overview

Import static Java methods/fields into Clojure

Public Variables and Functions



import-static

macro
Usage: (import-static class & fields-and-methods)
Imports the named static fields and/or static methods of the class
as (private) symbols in the current namespace.

Example: 
    user=> (import-static java.lang.Math PI sqrt)
    nil
    user=> PI
    3.141592653589793
    user=> (sqrt 16)
    4.0

Note: The class name must be fully qualified, even if it has already
been imported.  Static methods are defined as MACROS, not
first-class fns.
Source
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.