[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Creating new method combinations
- To: nmj@cs.flinders.oz.au
- Subject: Re: Creating new method combinations
- From: Gregor Kiczales <gregor@parc.xerox.com>
- Date: Sat, 25 Aug 1990 18:21:26 PDT
- Cc: CommonLoops.PARC@Xerox.com
- Fake-sender: gregor@parc.xerox.com
- In-reply-to: "\"\\\"nmj%cs.flinders.oz.au\\\"\".GV@Xerox.com's message of Fri, 24 Aug 1990 00:37:28 PDT <90Aug24.004655pdt.16170@alpha.xerox.com>"
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))