I assume that you are using some Common Lisp implementation.
That style of argument parsing is not directly supported by the standard lambda lists used by DEFMACRO. You are right in thinking that you will have to parse the arguments yourself (you could use (test &rest keys-and-forms)
to capture TEST, but extracting the :ELSE and :THEN parts would be up to you.
I am no super-(Common-)Lisper, but the syntax you are inventing here seems very non-idiomatic. The first hint is that macro lambda lists do not support what you want. Also, there are already standard alternatives that are the same length or shorter in raw characters typed (the typing overhead can be reduced a bit by using a structure editor like paredit in an Emacs).
(key-if blah :then foo bar) ; multiple then, no else
(when blah foo bar) ; standard
(key-if blah :else baz quux) ; no then, multiple else
(unless blah baz quux) ; standard
(key-if blah :then foo :else baz quux) ; one then, multiple else
(if blah foo (progn baz quux)) ; standard
(cond (blah foo) (t baz quux))
(key-if blah :then foo bar :else baz) ; multiple then, one else
(if blah (progn foo bar) baz) ; standard
(cond (blah foo bar) (t baz))
(key-if blah :then foo bar :else baz quux) ; multiple then, multiple else
(if blah (progn foo bar) (progn baz quux)) ; standard
(cond (blah foo bar) (t baz quux)) ; even shorter
(key-if blah :else baz quux :then foo bar) ; multiple else before multiple then
(if (not blah) (progn baz quux) (progn foo bar)) ; only standard variation that is longer
(cond ((not blah) baz quux) (t foo bar) ; standard, shorter
Common Lisp macros are very powerful code templating engines, but this particular usage makes me think that you are just not quite comfortable with the standard styles and idioms in Common Lisp. No matter which language you are using, it is almost always a good idea to “go with the flow” by adopting the ‘local’ styles and idioms instead of bringing styles and idioms from other languages with which you are more familiar.