Re: Evaluation of arguments in a macro

2008-10-27 Thread Matt Moriarity
well :title and :visible are not the only ones i want to support, i would like something that would work with any keyword and convert it to the right setter. you are right about the need for a let. i've been away from lisp for a while, and i forgot about this sort of thing. but will a let fix my

Re: Evaluation of arguments in a macro

2008-10-27 Thread mb
Hi, On 27 Okt., 21:08, Matt Moriarity <[EMAIL PROTECTED]> wrote: > I am trying to write a macro to rewrite something like this: > > (set-props my-jframe :title "blah" :visible true) > > Into calls to the setter methods. I finally settled on this: > > (defmacro set-props [obj & props] > (l

Evaluation of arguments in a macro

2008-10-27 Thread Matt Moriarity
I am trying to write a macro to rewrite something like this: (set-props my-jframe :title "blah" :visible true) Into calls to the setter methods. I finally settled on this: (defmacro set-props [obj & props] (let [prop-map (apply hash-map props)] `(do ~(for [[key val] prop-