From 6bd959229082f429d3232742bd93c40b67b29570 Mon Sep 17 00:00:00 2001 From: gerd <gerd> Date: Tue, 17 Jun 2003 10:25:56 +0000 Subject: [PATCH] * src/docs/cmu-user/macros.tex (defgeneric, defmethod): New environments. (defgenericx, defmethodx): New commands. * src/docs/cmu-user/extensions.tex (Primary Method Errors): New subsection. --- docs/cmu-user/extensions.tex | 29 +++++++++++++++++++++++++++++ docs/cmu-user/macros.tex | 28 ++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/docs/cmu-user/extensions.tex b/docs/cmu-user/extensions.tex index 5093e8528..b13e6311d 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 2cef149ce..911160a45 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} -- GitLab