#262 ag-macro-bind-params (interpreter top-level param binder) has no &key / &optional case
openFound by reading while chasing cave#261. ag-macro-bind-params (src/cold/compiler.lisp:3609) — the interpreter's TOP-LEVEL param binder, used by ag-eval-apply-function → ag-eval-bind-params for interpreted (tree-walker) function calls — handles only:
- &environment
- &rest
- cons param (destructure)
- else: positional bind
It has NO &key and NO &optional arm. So an interpreted call to a (name &key a b) function binds &KEY and each key name as POSITIONAL required params (nonsense), never pulling from the arg plist.
By contrast, its sibling ag-macro-bind-destructure (nested-pattern binder, :3641) DOES handle &key (ag-macro-bind-keys), &optional (ag-macro-bind-optionals), &rest, &allow-other-keys. So nested destructuring is correct but top-level &key/&optional binding is not.
Impact: any &key/&optional function reached via the INTERPRETER (compile-time macro calls, or a hosted-compile bail to the tree-walker) binds its params wrong. Likely a contributor to the cave#261 ensure-package &key breakage (still not fully root-caused — the arity error is from a compiled 1-arg prologue whose defun mysteriously reaches no instrumented compile/load path).
Fix: give ag-macro-bind-params the same &key/&optional arms as ag-macro-bind-destructure (or delegate the tail to it once a lambda-list marker is seen).
ASSESSMENT 2026-07-11: narrower than filed but still real — ag-macro-bind-params (tree-walker macro param binder) lacks &key/&optional. IMPACT SHRANK today: the macro-aware EVAL fix (0f0eed8) routes nested-eval macroexpansion through the HOSTED expander, so eval'd macros with &key/&optional params now work; the tree-walker binder only matters for the COLD compile path's prelude macros, which are already constrained to the closed op set. Downgrade to low priority; fix when a cold-path macro actually needs it.