[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How can I change the arguments of a generic function?



Thank you for many kind reply.

   From: naha@RIVERSIDE.SCRC.Symbolics.COM (Mark Nahabedian)
   You need to redefine the generic function using DEFGENERIC if you want
   to change its argument list.  Once you do that you will then need to
   make the corresponding change to the argument list of every method and
   recompile them.  This is true of every CLOS implementation.

   From: Marc Domenig <domenig@urz.unibas.ch>
   if you want to change the generic function, you can do this with
   Command-/, as suggested in the error message in the Listener. Example:

Yes I can. But if I type Command-/ to continue, existing methods are
removed. When I wrote those methods, I do not hesitate. But when they
are predefined methods, what should I do?

For example, if I define an :after method of set-view-font-code and try
to add a new keyword argument to it, Error: Incompatible lambda list
occurs.

? (defmethod set-view-font-codes :after ((kfm kanji-fred-mixin) ff ms
                                       &optional ff-mask ms-mask
                                       &key foo)
    ...)

> Error: Incompatible lambda list in #<STANDARD-METHOD SET-VIEW-FONT-CODES :AFTER (KANJI-FRED-MIXIN T T)> for #<STANDARD-GENERIC-FUNCTION SET-VIEW-FONT-CODES #x94A576>
> While executing: CCL::CHECK-DEFMETHOD-CONGRUENCY
> Type Command-/ to continue, Command-. to abort.
> If continued: Remove 5 methods from the generic-function and change its lambda list.
See the RestartsI menu item for further choices.
1 > 

If I type command-/, 5 set-view-font-codes methods are removed and the
result is not acceptable.

Is such attempt pseudo in itself?

Any suggestion would be appreciated.

Thank you.

Masaya UEDA