Skip to main content

method-combination-error

method-combination-error Function

Syntax:

method-combination-error format-control &rest args → implementation-dependent

Arguments and Values:

format-control—a format control.

argsformat arguments for format-control.

Description:

The function method-combination-error is used to signal an error in method combination.

The error message is constructed by using a format-control suitable for format and any args to it. Because an implementation may need to add additional contextual information to the error message, method-combination-error should be called only within the dynamic extent of a method combination function.

Whether method-combination-error returns to its caller or exits via throw is implementation dependent.

Side Effects:

The debugger might be entered.

Affected By:

*break-on-signals*

See Also:

define-method-combination signal

Expanded Reference: method-combination-error

Purpose

method-combination-error signals an error from within the body of a method combination. It is used when the set of applicable methods is inconsistent with what the method combination expects.

Signature

(method-combination-error format-control &rest format-arguments)

The arguments form a format control string and arguments describing the problem.

Typical Usage in define-method-combination

method-combination-error is called within define-method-combination to report problems such as missing required primary methods.

;; Conceptual example (within a define-method-combination body):
;; (when (null primary-methods)
;; (method-combination-error
;; "No primary methods for generic function ~S." generic-function))

Not Commonly Called Directly

Like invalid-method-error, this function is part of the method combination protocol. Application code normally does not call it directly. It is called by code generated by define-method-combination when the effective method cannot be computed.