The following definitions are used to construct and inspect generic procedures.
Creates and returns a new generic procedure. The generic procedure requires arity arguments.
Arity may take one of the following forms. An exact positive
integer specifies that the procedure will accept exactly that number of
arguments. A pair of two exact positive integers specifies inclusive
lower and upper bounds, respectively, on the number of arguments
accepted; the CDR may be
#f indicating no upper bound.
Name is used for debugging: it is a symbol that has no role in the
semantics of the generic procedure. Name may be
indicate that the generic procedure is anonymous. If name is not
specified, it defaults to
(define foo-bar (make-generic-procedure 2)) (define foo-baz (make-generic-procedure '(1 . 2) 'foo-baz)) (define foo-mum (make-generic-procedure '(1 . #f)))
Defines name to be a generic procedure. Lambda-list is an
ordinary parameter list, which is exactly like the parameter list in a
lambda special form. This expands into
(define name (make-generic-procedure arity (quote name)))
where arity is determined from lambda-list.
Examples (compare to examples of
(define-generic foo-bar (x y)) (define-generic foo-baz (x #!optional y)) (define-generic foo-mum (x . y))
#t if object is a generic procedure, otherwise
#f. Note that every generic procedure satisfies the
Returns the arity of generic-procedure, as specified in the call
make-generic-procedure. The returned arity must not be
Returns the name of generic-procedure, as specified in the call to