Macro help

Jan 08, 2013 16:08


So I'm finding myself writing macros that look like this
(defmacro set-from-map [objform valmapform & set-pairs]
  (let [obj (gensym)
        valmap (gensym)]
    `(let [~obj    ~objform
           ~valmap ~valmapform]
       (other stuff happens here))))
Those top two lets are basically just letting me make obj and valmap strict -- making them evaluate immediately instead of *pasting their code* wherever my macro might use them. I'm seeing this pattern a lot, and of course, Patterns Are Evil. Can anyone see an easy way to eradicate it?
Previous post
Up