manpagez: man pages & more
info guile
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.11.8 Method Definition Internals

define-method:

syntax: method (parameter …) . body

Make a method whose specializers are defined by the classes in parameters and whose procedure definition is constructed from the parameter symbols and body forms.

The parameter and body parameters should be as for define-method (see section define-method).

method:

procedure: make-method specializers procedure

Make a method using specializers and procedure.

specializers should be a list of classes that specifies the parameter combinations to which this method will be applicable.

procedure should be the closure that will applied to the generic function parameters when this method is invoked.

make-method is a simple wrapper around make with metaclass <method>.

generic: add-method! target method

Generic function for adding method method to target.

method: add-method! (generic <generic>) (method <method>)

Add method method to the generic function generic.

method: add-method! (proc <procedure>) (method <method>)

If proc is a procedure with generic capability (see section generic-capability?), upgrade it to a primitive generic and add method to its generic function definition.

method: add-method! (pg <primitive-generic>) (method <method>)

Add method method to the generic function definition of pg.

Implementation: (add-method! (primitive-generic-generic pg) method).

method: add-method! (whatever <top>) (method <method>)

Raise an error indicating that whatever is not a valid generic function.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on February 3, 2012 using texi2html 5.0.

© manpagez.com 2000-2017
Individual documents may contain additional copyright information.