Classes to Represent Method Definitions

These classes extend the basic class "function" when functions are to be stored and used as method definitions.


Method definition objects are functions with additional information defining how the function is being used as a method. The target slot is the class signature for which the method will be dispatched, and the defined slot the signature for which the method was originally specified (that is, the one that appeared in some call to setMethod).

Objects from the Class

The action of setting a method by a call to setMethod creates an object of this class. It's unwise to create them directly.

The class "SealedMethodDefinition" is created by a call to setMethod with argument sealed = TRUE. It has the same representation as "MethodDefinition".



Object of class "function"; the data part of the definition.


Object of class "signature"; the signature for which the method was wanted.


Object of class "signature"; the signature for which a method was found. If the method was inherited, this will not be identical to target.


Object of class "character"; the function for which the method was created.


Class "function", from data part. Class "PossibleMethod", directly. Class "OptionalMethods", by class "function".

See Also

class '>MethodsList for the objects defining sets of methods associated with a particular generic function. The individual method definitions stored in these objects are from class MethodDefinition, or an extension. Class '>MethodWithNext for an extension used by callNextMethod.

  • MethodDefinition-class
  • SealedMethodDefinition-class
Documentation reproduced from package methods, version 3.5.2, License: Part of R 3.5.2

Community examples

Looks like there are no examples yet.