Namespaces

 
1.0.0-SNAPSHOT permalink Arrow_down_16x16
  • (let-select nodes-or-fragments bindings & body)
For each node or fragment, performs a subselect and bind it to a local,
then evaluates body.
bindings is a vector of binding forms and selectors.

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 net/cgrand/enlive_html.clj:880 top

(defmacro let-select
 "For each node or fragment, performs a subselect and bind it to a local, 
  then evaluates body.
  bindings is a vector of binding forms and selectors." 
 [nodes-or-fragments bindings & body]
  (let [node-or-fragment (gensym "node-or-fragment__")
        bindings 
          (map (fn [f x] (f x)) 
            (cycle [identity (fn [spec] `(select ~node-or-fragment ~spec))])
            bindings)] 
    `(map (fn [~node-or-fragment] 
            (let [~@bindings]
              ~@body)) ~nodes-or-fragments)))
Vars in net.cgrand.enlive-html/let-select: defmacro let apply concat fn list map seq vector
Used in 0 other vars

Comments top

No comments for let-select. Log in to add a comment.