In fact I was wrong.  I checked with CLISP and #lisp, and they agree: optional arguments are filled before any keyword detection begins.

On Thu, Oct 17, 2019 at 7:25 PM John Cowan <> wrote:

On Thu, Oct 17, 2019 at 5:31 PM Lassi Kortela <> wrote:
Is the following a reasonable summary?

Common Lisp style:

* Find out the arity of `f`

* If `y` appears in the argument list before the position where
   keywords start, treat it as an optional arg (not a keyword arg) no
   matter what kind of object it is (keyword, list, anything else).

In fact no.  Mandatory arguments are always treated as mandatory arguments, but if an optional argument is a keyword object and there are an even number of arguments left to process, keyword processing begins at once.  This can cause problems: you cannot pass a keyword to an optional argument.

John Cowan
Do I contradict myself?
Very well then, I contradict myself.
I am large, I contain multitudes.
        --Walt Whitman, Leaves of Grass