diff --git a/docs/cmu-user/extensions.tex b/docs/cmu-user/extensions.tex index 5093e8528ac538ab554b6041962a27766ec23bd9..b13e6311debc6be878f4718b3433a84e2fd6b2a1 100644 --- a/docs/cmu-user/extensions.tex +++ b/docs/cmu-user/extensions.tex @@ -1860,6 +1860,35 @@ way to browse the library. \section{CLOS} +\subsection{Primary Method Errors} +\cindex{primary method} + +The standard requires that an error is signaled when a generic +function is called and + +\begin{itemize} +\item no primary method is applicable to the generic function's actual + arguments, and +\item the generic function's method combination is either the standard + method combination or a method combination defined with the short + form of \code{define-method-combination}. The latter includes the + standardized method combinations like \code{progn}, \code{and}, etc. +\end{itemize} + +\begin{defgeneric}{pcl:}{no-primary-method}{gf \&rest args} + In \cmucl, this generic function is called in the above erroneous + cases. The parameter \code{gf} is the generic function being + called, and \code{args} is a list of actual arguments in the generic + function call. +\end{defgeneric} + +\begin{defmethod}{pcl:}{no-primary-method}{% + (gf standard-generic-function) \&rest args} + This method signals a continuable error of type + \code{pcl:no-primary-method-error}. +\end{defmethod} + + \subsection{Slot Type Checking} \cindex{slot type checking} diff --git a/docs/cmu-user/macros.tex b/docs/cmu-user/macros.tex index 2cef149ce6de132dd90fa0ee5bc0e623edc49ef6..911160a4502baae9f24c7f794bc19327ea24997a 100644 --- a/docs/cmu-user/macros.tex +++ b/docs/cmu-user/macros.tex @@ -130,6 +130,34 @@ \par\fnindexbold{#2}\label{FN:#2}% \layout[#1]{#2}{#3}{Function}} +%% Define a generic function +%% +%% \begin{defgeneric}{pkg}{name}{params} +%% \defgenericx[pkg]{name}{params} +%% description of function +%% \end{defgeneric} +\newenvironment{defgeneric}[3]{% + \par\defunvspace\fnindexbold{#2}\label{FN:#2}% + \layout[#1]{#2}{#3}{Generic Function} + }{} +\newcommand{\defgenericx}[3][\mbox{}]{% + \par\fnindexbold{#2}\label{FN:#2}% + \layout[#1]{#2}{#3}{Generic Function}} + +%% Define a method +%% +%% \begin{defmethod}{pkg}{name}{params} +%% \defmethod[pkg]{name}{params} +%% description of function +%% \end{defmethod} +\newenvironment{defmethod}[3]{% + \par\defunvspace\fnindexbold{#2}\label{FN:#2}% + \layout[#1]{#2}{#3}{Method} + }{} +\newcommand{\defmethodx}[3][\mbox{}]{% + \par\fnindexbold{#2}\label{FN:#2}% + \layout[#1]{#2}{#3}{Method}} + %% Define a macro %% %% \begin{defmac}{pkg}{name}{params}