Re: java interoperability : calling set! on several fields of the same instance

2009-07-23 Thread Laurent PETIT
Yes it works ! : 1:172 user=> (doto (java.awt.Point.) (-> .x (set! 2))) # I hadn't thought about this possible combination, thanks Meikel. So now, is mset! worth the trouble ? Let's compare them again: (doto (SomeBeanCtor.) (-> .field1 (set! expr1)) (-> .field2 (set! expr2)) (-> .field4 (s

Re: java interoperability : calling set! on several fields of the same instance

2009-07-23 Thread Meikel Brandmeyer
Hi, Am 23.07.2009 um 18:24 schrieb Laurent PETIT: Hello, I want to call set! several times on a same instance, e.g. : (let [instance (SomeBeanCtor.)] (set! (. instance field1) expr1) (set! (. instance field2) expr2) ...) Do you know if a macro simplifying this already exists ? How abo

java interoperability : calling set! on several fields of the same instance

2009-07-23 Thread Laurent PETIT
Hello, I want to call set! several times on a same instance, e.g. : (let [instance (SomeBeanCtor.)] (set! (. instance field1) expr1) (set! (. instance field2) expr2) ...) Do you know if a macro simplifying this already exists ? Anyway, I've created one as an exercise, and here it is: (def