[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Finding "Non-applicable" Methods
- To: commonloops.pa@Xerox.COM
- Subject: Finding "Non-applicable" Methods
- From: David E. Wallace <email@example.com>
- Date: Fri, 23 Dec 88 11:57:20 PST
- Redistributed: commonloops.pa
The CLOS Spec in Chapters 1 & 2 offers a way to find all applicable methods
for a given set of arguments, but it doesn't seem to provide any way to
determine what methods might be applicable to a different set of arguments.
What I would like to see is (1): a way to get all currently defined methods
on a particular generic function, and (2): a way to determine, given a method
object, what set of arguments would select it. Is there a
portable way to do this with the spec as it now stands? If not, is it
still possible to submit something like this as a cleanup proposal?
Applications would include:
(1): Debugging (the obvious one)
(2): A coercion planner. Given a multi-method coerce-meth that takes
an object and a type to coerce it to, define a default case that will try
to plan a multi-step strategy to coerce the object to a type based on
all currently defined coercions (if I want to coerce an A to a D, and have
methods defined to coerce an A to a B, a B to a C, and a C to a D, this
would be an acceptable strategy).
(3): A DWIM-like fixup method when no-applicable-method arises
(determine what methods do exist, and query the user about using methods
that are "close" to the actual arguments supplied).