Hi,

if you always follow the let structure you outlined the following might work. 
Untested, though. Note, that things work recursively with this approach.

(def ours? #{#'button #'label ...})

(defmacro panel
  [{:keys [id]} & components]
  (let [[bindings body]
        (reduce (fn [[bindings body] component]
                  (if (and (seq? component)
                           (ours? (resolve &env (first component))))
                    (let [[_let local-bindings & local-body]
                          (macroexpand-1 component)]
                      [(into bindings local-bindings) (into body local-body)])
                    ; Keep stuff we don't know.
                    [bindings (conj body component)]))
                [[id `(JPanel.)] []]
                components)]
    `(let ~bindings
       ~@body
       ...
       ~id)))

Sincerely
Meikel

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to