call-next-method
Factor handbook » The language » Objects » Generic words and methods » Calling less-specific methods

Next:(call-next-method) ( method -- )


Vocabulary
syntax

Syntax
call-next-method


Word description
Calls the next applicable method. Only valid inside a method definition. The values at the top of the stack are passed on to the next method, and they must be compatible with that method's class specializer.

Notes
This word looks like an ordinary word but it is a parsing word. It cannot be factored out of a method definition, since the code expansion references the current method object directly.

Errors
Throws a no-next-method error if this is the least specific method, and throws an inconsistent-next-method error if the values at the top of the stack are not compatible with the current method's specializer.

See also
(call-next-method), next-method

Definition