Re: Macros, macros, macros

2011-03-09 Thread Meikel Brandmeyer
Hi again, On 9 Mrz., 09:23, Meikel Brandmeyer wrote: > (defmacro query >   [rec [lhs op rhs]] >   (case op >     'and `(-> ~rec (query ~lhs) .and (query ~rhs)) >     'eq  `(-> ~rec (.field ~(name lhs)) (.eq ~rhs Here a short note, why a macro can be actually annoying: If you write macro wh

Re: Macros, macros, macros

2011-03-09 Thread Meikel Brandmeyer
Hi, On 9 Mrz., 08:52, Andreas Kostler wrote: >>> (defn make-native-query [db str foo] >>>             (. (proxy [ONativeSynchQuery] >>>                    [db str foo] >>>                    (filter [rec] >>>                         (.. rec (field "location") (eq "Madrid") and (field >>> "name"

Re: Macros, macros, macros

2011-03-08 Thread Andreas Kostler
On 09/03/2011, at 4:24 PM, Alan wrote: > On Mar 8, 9:14 pm, Andreas Kostler > wrote: >> Hi Daniel, >> Thanks for your reply. >> On 09/03/2011, at 11:57 AM, Daniel Solano Gomez wrote: >>> On Wed Mar 9 11:16 2011, Andreas Kostler wrote: Hi all, >> I need a macro to basically outputs th

Re: Macros, macros, macros

2011-03-08 Thread Alan
On Mar 8, 9:14 pm, Andreas Kostler wrote: > Hi Daniel, > Thanks for your reply. > On 09/03/2011, at 11:57 AM, Daniel Solano Gomez wrote: > > On Wed Mar  9 11:16 2011, Andreas Kostler wrote: > >> Hi all, > > >> I need a macro to basically outputs this: > > >> (macroexpand '(chain-field-queries reco

Re: Macros, macros, macros

2011-03-08 Thread Andreas Kostler
Hi Daniel, Thanks for your reply. On 09/03/2011, at 11:57 AM, Daniel Solano Gomez wrote: > On Wed Mar 9 11:16 2011, Andreas Kostler wrote: >> Hi all, >> >> I need a macro to basically outputs this: >> >> (macroexpand '(chain-field-queries record "location" "name" "country")) >> (. (. (. record

Re: Macros, macros, macros

2011-03-08 Thread Daniel Solano Gomez
On Wed Mar 9 11:16 2011, Andreas Kostler wrote: > Hi all, > > I need a macro to basically outputs this: > > (macroexpand '(chain-field-queries record "location" "name" "country")) > (. (. (. record (field "location")) (field "name")) (field "country")) > > Which chains method calls on a java ob

Macros, macros, macros

2011-03-08 Thread Andreas Kostler
Hi all, I need a macro to basically outputs this: (macroexpand '(chain-field-queries record "location" "name" "country")) (. (. (. record (field "location")) (field "name")) (field "country")) Which chains method calls on a java object. e.g. record.field("location").field("name").field("country