How can I mix optional keyword arguments with the & rest stuff?
- by Rayne
I have a macro that takes a body:
(defmacro blah [& body] (dostuffwithbody))
But I'd like to add an optional keyword argument to it as well, so when called it could look like either of these:
(blah :specialthingy 0 body morebody lotsofbody)
(blah body morebody lotsofboy)
How can I do that? Note that I'm using Clojure 1.2, so I'm also using the new optional keyword argument destructuring stuff. I naively tried to do this:
(defmacro blah [& {specialthingy :specialthingy} & body])
But obviously that didn't work out well. How can I accomplish this or something similar?