(goops.info.gz) Generic Function Internals
Info Catalog
(goops.info.gz) Basic Generic Function Creation
(goops.info.gz) Creating Generic Functions
(goops.info.gz) Extending Guiles Primitives
Generic Function Internals
--------------------------
`define-generic' calls `ensure-generic' to upgrade a pre-existing
procedure value, or `make' with metaclass `<generic>' to create a new
generic function.
`define-accessor' calls `ensure-accessor' to upgrade a pre-existing
procedure value, or `make-accessor' to create a new accessor.
- procedure: ensure-generic old-definition [name]
Return a generic function with name NAME, if possible by using or
upgrading OLD-DEFINITION. If unspecified, NAME defaults to `#f'.
If OLD-DEFINITION is already a generic function, it is returned
unchanged.
If OLD-DEFINITION is a Scheme procedure or procedure-with-setter,
`ensure-generic' returns a new generic function that uses
OLD-DEFINITION for its default procedure and setter.
Otherwise `ensure-generic' returns a new generic function with no
defaults and no methods.
- procedure: make-generic [name]
Return a new generic function with name `(car NAME)'. If
unspecified, NAME defaults to `#f'.
`ensure-generic' calls `make' with metaclasses `<generic>' and
`<generic-with-setter>', depending on the previous value of the
variable that it is trying to upgrade.
`make-generic' is a simple wrapper for `make' with metaclass
`<generic>'.
- procedure: ensure-accessor proc [name]
Return an accessor with name NAME, if possible by using or
upgrading PROC. If unspecified, NAME defaults to `#f'.
If PROC is already an accessor, it is returned unchanged.
If PROC is a Scheme procedure, procedure-with-setter or generic
function, `ensure-accessor' returns an accessor that reuses the
reusable elements of PROC.
Otherwise `ensure-accessor' returns a new accessor with no defaults
and no methods.
- procedure: make-accessor [name]
Return a new accessor with name `(car NAME)'. If unspecified,
NAME defaults to `#f'.
`ensure-accessor' calls `make' with metaclass `<generic-with-setter>',
as well as calls to `ensure-generic', `make-accessor' and (tail
recursively) `ensure-accessor'.
`make-accessor' calls `make' twice, first with metaclass `<generic>' to
create a generic function for the setter, then with metaclass
`<generic-with-setter>' to create the accessor, passing the setter
generic function as the value of the `#:setter' keyword.
Info Catalog
(goops.info.gz) Basic Generic Function Creation
(goops.info.gz) Creating Generic Functions
(goops.info.gz) Extending Guiles Primitives
automatically generated byinfo2html