+ inside-args)))))
+
+;;; Eliminate keyword arguments from the call (leaving the
+;;; parameters in place.
+;;;
+;;; (FOO ... :BAR X :QUUX Y)
+;;; becomes
+;;; (FOO ... X Y)
+;;;
+;;; SPECS is a list of (:KEYWORD PARAMETER) specifications.
+;;; Returns the list of specified parameters names in the
+;;; order they appeared in the call. N-POSITIONAL is the
+;;; number of positional arguments in th call.
+(defun eliminate-keyword-args (call n-positional specs)
+ (let* ((specs (copy-tree specs))
+ (all (combination-args call))
+ (new-args (reverse (subseq all 0 n-positional)))
+ (key-args (subseq all n-positional))
+ (parameters nil))
+ (loop while key-args
+ do (let* ((key (pop key-args))
+ (val (pop key-args))
+ (keyword (if (constant-lvar-p key)
+ (lvar-value key)
+ (give-up-ir1-transform)))
+ (spec (or (assoc keyword specs :test #'eq)
+ (give-up-ir1-transform))))
+ (push val new-args)
+ (flush-dest key)
+ (push (second spec) parameters)
+ ;; In case of duplicate keys.
+ (setf (second spec) (gensym))))
+ (setf (combination-args call) (reverse new-args))
+ (reverse parameters)))