Article View: comp.lang.clos
Article #299Re: Finding valid initargs to MAKE-INSTANCE
From: Gregor Kiczales
Date: Mon, 28 Sep 1992 11:46
Date: Mon, 28 Sep 1992 11:46
29 lines
1612 bytes
1612 bytes
From: charest@Aig.Jpl.Nasa.Gov (Len Charest) Date: Fri, 25 Sep 1992 22:41:27 GMT How do I determine the valid initargs for a method on MAKE-INSTANCE? For example, when programmatically creating a class: (make-instance 'standard-class :name 'green :direct-superclasses (mapcar #'find-class '(yellow blue))) How can I determine whether a given implementation supports the (MOPish) :NAME and :DIRECT-SUPERCLASSES initargs... I think this piece of code should be easy to write with the MOP. Use compute-applicable-methods, class-prototype and method-lambda-list to figure out what keywords all the methods accept. (Actually, it might be good to split this out as a seperate operation that works on any generic function, or list of methods.) Then use class-slots and slot-definition-initargs to figure out what slot filling initargs the standard method on shared-initialize accepts. You should actually be able to figure out what you want to know this way. If you can't, that may say something about the initialization protocol. Gregor
Technical Details
Message-ID:
<GREGOR.92Sep28114626@tracer-bullet.parc.xerox.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!decwrl!parc!gregorReferences:
<1992Sep25.224127.21078@jpl-devvax.jpl.nasa.gov>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.clos Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!parc!gregor From: gregor@parc.xerox.com (Gregor Kiczales) Subject: Re: Finding valid initargs to MAKE-INSTANCE In-Reply-To: charest@Aig.Jpl.Nasa.Gov's message of Fri, 25 Sep 1992 22:41:27 GMT Message-ID: <GREGOR.92Sep28114626@tracer-bullet.parc.xerox.com> Sender: news@parc.xerox.com Organization: Xerox Palo Alto Research Center References: <1992Sep25.224127.21078@jpl-devvax.jpl.nasa.gov> Distribution: all Date: 28 Sep 92 11:46:26 Lines: 29