[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Gregor.pa@XEROX.COM
- Subject: Re: ensure-generic-function
- From: Patrick H Dussud <DUSSUD%Jenner%ti-csl.csnet@RELAY.CS.NET>
- Date: 12-Feb-87 07:23:50
- Cc: Common-Lisp-Object-System@SAIL.STANFORD.EDU
- In-reply-to: In-Reply-To: Msg of 6-Feb-87 14:14:00 from Gregor.firstname.lastname@example.orgMsg of 6-Feb-87 14
- Sender: DUSSUD%Jenner%ti-csl.csnet@RELAY.CS.NET
Date: 6-Feb-87 14:14:00
Try this for ensure-generic-function:
If symbol is fboundp to a generic-function of the same class as
<generic-function-class> then this function does nothing
and returns the generic function object.
If symbol is fboundp to a generic-function of some other class, the
generic-function class changing protocol is followed, see chapter3.
If we don't want the type of the generic function to be changed, we can
pass (CLASS-NAMED 'GENERIC-FUNCTION) to the keyword-arg
If symbol not foundp a generic function of generic-function-class is
created and put in symbol's function cell.
If this function is meant to be used to normalize the argument to
GET-METHOD then it's not okay to create the generic function. We can
work around it by checking if the symbol is FBOUNDP before calling it
but a situation like this seems to be frequent enough so
ensure-generic-function should handle it.
If symbol is boundp to a function, and make-exisiting-function-default-p
is not nil, a generic-function is created, put in the function cell, a
default method is added to the generic-function and the symbol's
previous function cell value is used as the function for the default
If symbol is fboundp to a function and make-exisiting-function-default-p
is nil an error is signalled.
If symbol names a macro or a special form, an error is signalled.