(defgeneric preprocess-command (shell-utility command &rest arguments) (:method ((s shell-utility) command &rest arguments) (declare (ignore arguments)) (warn "Default method on PREPROCESS-COMMAND invoked; unknown command?"))) (defgeneric preprocess-commands (shell-utility) (:method ((shell-utility shell-utility)) (dolist (shell-utility (commands shell-utility)) (preprocess-command shell-utility command)))) (defmacro define-preprocess-command ((var class) (command &rest arguments) &body body) (with-gensyms (command-var args) `(defmethod preprocess-command ((,var ,class) (,command-var (eql ',command)) &rest ,args) (destructuring-bind ,arguments ,args ,@body))))