The reason macros don't work is because in both cases the value for the params argument is the params character. This is why in add-where-conditions-2 and add-where-conditions-3 , when the macros make a call (make-conds params) , the value that the function receives is not the list you are thinking of, but the params symbol that displays line error:
IllegalArgumentException Don't know how to create ISeq from: clojure.lang.Symbol clojure.lang.RT.seqFrom (RT.java:505)
The first case works because the function receives the list (rather than the character) as the value for the params argument, so eval receives the list (where {:your-query nil} (or (between :freq [100 200]) ,,,)) , which expects the where macro and knows how to handle it.
The where macro parses an expression for some of the predicates it uses to build expressions. where* , an alternative to a function, does not have such functionality, so I canβt come up with an alternative to eval for eating a cake and having it too.
source share