import

macrosince v0.0-2985 clojure.core/importEdit
(import & import-symbols-or-lists)

Details:

import-list => (closure-namespace constructor-name-symbols*)

Only usable from a REPL.

Import Google Closure classes.


Examples:

(import 'goog.math.Long
        '[goog.math Vec2 Vec3]
        '[goog.math Integer])

(Long. 4 6)
;;=> #<25769803780>

(Vec2. 1 2)
;;=> #<(1, 2)>

(Vec3. 1 2 3)
;;=> #<(1, 2, 3)>

(Integer.fromString "10")
;;=> #<10>

Source docstring:
import-list => (closure-namespace constructor-name-symbols*)

For each name in constructor-name-symbols, adds a mapping from name to the
constructor named by closure-namespace to the current namespace. Use :import in the ns
macro in preference to calling this directly.
Source code @ clojurescript:src/main/clojure/cljs/core.cljc
(core/defmacro import
  [& import-symbols-or-lists]
  `(~'ns* ~(cons :import import-symbols-or-lists)))