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

Prev:Method precedence
Next:Custom method combination


If a generic word is called with an object and multiple methods specialize on classes that this object is an instance of, usually the most specific method is called (Method precedence).

Less-specific methods can be called directly:
Image
call-next-method


A lower-level word which the above expands into:
Image
(call-next-method) ( method -- )


To look up the next applicable method reflectively:
Image
next-method ( class generic -- method/f )


Errors thrown by improper calls to call-next-method:
Image
inconsistent-next-method ( class generic -- * )

Image
no-next-method ( method -- * )