chiark / gitweb /
doc/concepts.tex: Highlight method role names.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 15 Dec 2015 14:31:01 +0000 (14:31 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 15 Dec 2015 14:31:01 +0000 (14:31 +0000)
doc/concepts.tex

index 46d99b1669bfe56356beca5707c1c84c159e49be..9a77c446f916cb0b285f0e7da429e9d7892e4a37 100644 (file)
@@ -507,9 +507,9 @@ argument lists which \emph{match} the message's argument list:
 \item if the message accepts a variable-length argument suffix then the
   direct method must instead have a final argument of type @|va_list|.
 \end{itemize}
 \item if the message accepts a variable-length argument suffix then the
   direct method must instead have a final argument of type @|va_list|.
 \end{itemize}
-Primary and around methods must have the same return type as the message;
-before and after methods must return @|void| regardless of the message's
-return type.
+Primary and @|around| methods must have the same return type as the message;
+@|before| and @|after| methods must return @|void| regardless of the
+message's return type.
 
 If there are no applicable primary methods then no effective method is
 constructed: the vtables contain null pointers in place of pointers to method
 
 If there are no applicable primary methods then no effective method is
 constructed: the vtables contain null pointers in place of pointers to method
@@ -523,21 +523,22 @@ follows.
   specific such method, with respect to the class of the receiving object, is
   invoked.
 
   specific such method, with respect to the class of the receiving object, is
   invoked.
 
-  Within the body of an around method, the variable @|next_method| is
+  Within the body of an @|around| method, the variable @|next_method| is
   defined, having pointer-to-function type.  The method may call this
   function, as described below, any number of times.
 
   defined, having pointer-to-function type.  The method may call this
   function, as described below, any number of times.
 
-  If there any remaining around methods, then @|next_method| invokes the next
-  most specific such method, returning whichever value that method returns;
-  otherwise the behaviour of @|next_method| is to invoke the before methods
-  (if any), followed by the most specific primary method, followed by the
-  around methods (if any), and to return whichever value was returned by the
-  most specific primary method.  That is, the behaviour of the least specific
-  around method's @|next_method| function is exactly the behaviour that the
-  effective method would have if there were no around methods.
+  If there any remaining @|around| methods, then @|next_method| invokes the
+  next most specific such method, returning whichever value that method
+  returns; otherwise the behaviour of @|next_method| is to invoke the before
+  methods (if any), followed by the most specific primary method, followed by
+  the @|around| methods (if any), and to return whichever value was returned
+  by the most specific primary method.  That is, the behaviour of the least
+  specific @|around| method's @|next_method| function is exactly the
+  behaviour that the effective method would have if there were no @|around|
+  methods.
 
 
-  The value returned by the most specific around method is the value returned
-  by the effective method.
+  The value returned by the most specific @|around| method is the value
+  returned by the effective method.
 
 \item If any applicable methods have the @|before| role, then they are all
   invoked, starting with the most specific.
 
 \item If any applicable methods have the @|before| role, then they are all
   invoked, starting with the most specific.
@@ -554,20 +555,21 @@ follows.
   invoke the next most specific applicable primary method, and to return
   whichever value that method returns.
 
   invoke the next most specific applicable primary method, and to return
   whichever value that method returns.
 
-  If there are no applicable around methods, then the value returned by the
-  most specific primary method is the value returned by the effective method;
-  otherwise the value returned by the most specific primary method is
-  returned to the least specific around method, which called it via its own
-  @|next_method| function.
+  If there are no applicable @|around| methods, then the value returned by
+  the most specific primary method is the value returned by the effective
+  method; otherwise the value returned by the most specific primary method is
+  returned to the least specific @|around| method, which called it via its
+  own @|next_method| function.
 
 \item If any applicable methods have the @|after| role, then they are all
   invoked, starting with the \emph{least} specific.  (Hence, the most
 
 \item If any applicable methods have the @|after| role, then they are all
   invoked, starting with the \emph{least} specific.  (Hence, the most
-  specific after method is invoked with the most `afterness'.)
+  specific @|after| method is invoked with the most `afterness'.)
 
 \end{enumerate}
 
 
 \end{enumerate}
 
-A typical use for around methods is to set up the dynamic environment
-appropriately for the primary methods, e.g., by claiming a lock.
+A typical use for @|around| methods is to allow a base class to set up the
+dynamic environment appropriately for the primary methods of its subclasses,
+e.g., by claiming a lock, and restore it afterwards.
 
 The @|next_method| function provided to methods with the @|primary| and
 @|around| roles accepts the same arguments, and returns the same type, as the
 
 The @|next_method| function provided to methods with the @|primary| and
 @|around| roles accepts the same arguments, and returns the same type, as the
@@ -598,8 +600,8 @@ the applicable primary methods in turn and aggregate the return values from
 each.
 
 The aggregating method combinations accept the same four roles as the
 each.
 
 The aggregating method combinations accept the same four roles as the
-standard method combination, and around, before, and after methods work in
-the same way.
+standard method combination, and @|around|, @|before|, and @|after| methods
+work in the same way.
 
 The aggregating method combinations provided are as follows.
 \begin{description} \let\makelabel\code
 
 The aggregating method combinations provided are as follows.
 \begin{description} \let\makelabel\code