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

Re: Creating new method combinations



   Subject: Creating new method combinations
   From: nick(j). <nmj@cs.flinders.oz.au>

   (wrt 22/5/90 PCL (REV 2) and AKCL 1.485)

     I've been trying to create new method combinations using:
     "define-method-combination" (long form) and the object
     returned is:

    #<Standard-Method PCL::FIND-METHOD-COMBINATION (PCL::GENERIC-FUNCTION
						   RULE T) 16050520>

     (for a combination called "rule"). What I'd like to do is
     have this new combination method replace the original standard
     combination (by setq'ing pcl::*standard-method-combination* with this
     value!?! am I an the right track?????)

The short answer is that you can't do this.

What you are trying to do is, for all intensive purposes, analogous to
saying "well, for my program, I would like cons to do something a little
different, so I will just redefine it."

What you may want to do is shadow the symbol DEFGENERIC in your package,
changing its behavior so that, by default, it uses your kind of method
combination.  One, overly simple, way to do this is as follows:

(in-package 'my-package)
(shadow 'defgeneric)

(defmacro defgeneric (name ll &rest options)
 `(pcl:defgeneric ,name ,ll (:method-combination rule) ,@options))