with-direct-linking

clojure.contrib.macros

  • (with-direct-linking symbols? & body)
EXPERIMENTAL!
Compiles the functions in body with direct links to the functions
named in symbols, i.e. without a var lookup for each invocation.
Symbols is a vector of symbols that name either vars or namespaces.
A namespace reference is replaced by the list of all symbols in the
namespace that are bound to functions. If symbols is not provided,
the default value ['clojure.core] is used. The symbol *ns* can be
used to refer to the current namespace.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/macros.clj:68 top

(defmacro with-direct-linking
  "EXPERIMENTAL!
   Compiles the functions in body with direct links to the functions
   named in symbols, i.e. without a var lookup for each invocation.
   Symbols is a vector of symbols that name either vars or namespaces.
   A namespace reference is replaced by the list of all symbols in the
   namespace that are bound to functions. If symbols is not provided,
   the default value ['clojure.core] is used. The symbol *ns* can be
   used to refer to the current namespace."
  {:arglists '([symbols? & body])}
  [& body]
  (let [[symbols body] (if (vector? (first body))
                         [(first body) (rest body)]
                         [['clojure.core] body])
  			bindings (vec (mapcat expand-symbol symbols))]
    `(let ~bindings ~@body)))
Vars in clojure.contrib.macros/with-direct-linking: defmacro let concat list seq
Used in 0 other vars

Comments top

No comments for with-direct-linking. Log in to add a comment.