12 The Built-In Functions
generic-function-methods
[Function]
generic-function-methods generic-function
Þ sequence
<generic-function>
.
<sequence>
. Each element in the sequence is an instance of <method>
.
If generic-function is sealed, an implementation may choose not to return a sequence of methods, but instead signal an error of type <sealed-object-error>.
add-method
[Function]
add-method generic-function method
Þ new-method old-method
<generic-function>
.
<method>
.
<method>
.
#f
or an instance of <method>
.
Programs do not commonly call add-method directly. It is called by define method.
If you add a method to a generic function, and the generic function already has a method with the exact same specializers, then the old method is replaced with the new one.
A single method may be added to any number of generic functions.
add-method returns two values. The first is the new method. The second will be either the method in generic-function which is being replaced by method, or it will be #f if no method is being replaced.
add-method
may signal an error of type <sealed-object-error>
if adding the method or replacing an existing method would cause a sealing violation.
generic-function-mandatory-keywords
[Function]
generic-function-mandatory-keywords generic-function
Þ keywords
<generic-function>
.
#f
or an instance of <collection>
.
The collection returned should never be destructively modified. Doing so may cause unpredictable behavior.
function-specializers
[Function]
function-specializers function
Þ sequence
<function>
.
<sequence>
. The elements of the sequence are instances of <type>
.
The sequence returned should never be destructively modified. Doing so may cause unpredictable behavior.
function-arguments
[Function]
function-arguments function
Þ required-number rest-boolean kwd-sequence
<function>
.
<integer>
.
<boolean>
.
#f
or the symbol #"all"
or an instance of <collection>
whose elements are instances of <keyword>
.
#"all"
if all keywords are permitted by the function.Note that particular calls to a generic function may accept additional keywords not included in the third value returned by function-arguments, by virtue of their being recognized by applicable methods.
function-return-values
[Function]
function-return-values function
Þ return-value-types rest-return-value
<function>
.
<sequence>
. The elements of the sequence are instances of <type>
.
<type>
or #f
.
#f
is returned; otherwise a type is returned.
applicable-method?
[Function]
applicable-method? function
#rest sample-arguments Þ boolean
<function>
.
<object>
.
<boolean>
.
sorted-applicable-methods
[Function]
sorted-applicable-methods generic-function
#rest sample-arguments
<generic-function>
.
<object>
.
<sequence>
. Elements of the sequence are instances of <method>
.
<sequence>
. Elements of the collection are instances of <method>
.
The sequences returned should never be destructively modified. Doing so may cause unpredictable behavior.
find-method
[Function]
find-method generic-function specializers
Þ found-method
<generic-function>
.
<sequence>
. Elements of the sequence are instances of <type>
.
#f
or an instance of <method>
.
If generic-function is sealed, an implementation may choose to signal an error of type <sealed-object-error> rather than return a value.
remove-method
[Function]
remove-method generic-function method
Þ method
<generic-function>
.
<method>
.
<method>
.
remove-method will signal an error if method is not in generic-function. If generic-function is sealed, or if method is in an inert domain of generic-function , then an error of type <sealed-object-error> is signaled.
Generated with Harlequin WebMaker