From 9d8f0ddd03e6216e0e3afe33afd1309c8d8e7bbf Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Sat, 13 Jun 2020 00:15:42 +0200 Subject: [PATCH] Fix strange uses of \emph for external objects Fixes #2557 --- chapters/functions.tex | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/chapters/functions.tex b/chapters/functions.tex index 0af705a57..523c240cb 100644 --- a/chapters/functions.tex +++ b/chapters/functions.tex @@ -2555,35 +2555,27 @@ \subsection{External Objects}\doublelabel{external-objects} be complete (e.g., from an initial algorithm or initial equation). The destructor shall delete the object, and must not require any other calls to be made for the deletion to be complete (e.g., from a \lstinline!when terminal()! clause). The constructor may not assume that pointers sent - to the external object will remain valid for the life-time of the - external object. + to the external object will remain valid for the life-time of the external object. An exception is that if the pointer to another external object is + given as argument to the constructor, that pointer will remain valid as long as the other external object lives. \begin{nonnormative} - An exception is that if the pointer to another external object is given as argument to the constructor, that pointer will remain valid as long as the other external object lives. + External objects may be a protected component (or part of one) in a function. The constructor is in that case called at the start of the function call, + and the destructor when the function returns, or when recovering from errors in the function. + \end{nonnormative} + \begin{nonnormative} + External objects may be an input (or part of an input) to a function, in that case the destructor is not called (since the external object is active before + and after the function call). Normally this is an external function, but it could be a non-external function as well (e.g.\ calling external functions one + or more times). The function input may not have a default value using the constructor. \end{nonnormative} - - \emph{External objects may be a protected component (or part of one) - in a function. The constructor is in that case called at the start of - the function call, and the destructor when the function returns, or - when recovering from errors in the function.} - - \emph{External objects may be an input (or part of an input) to a - function, in that case the destructor is not called (since the - external object is active before and after the function call). - Normally this is an external function, but it could be a non-external - function as well (e.g. calling external functions one or more times). - The function input may not have a default value using the - constructor.} \item Classes derived from \lstinline!ExternalObject! can neither be used in an extends-clause nor in a short class definition. \item - Only the constructor may return external objects and external object + Only the constructor may return external objects and an external object can only be bound in component declarations and neither modified later nor assigned to. - - \emph{No function may return a component containing an external object - (since only the constructor may return an external object and the - constructor exactly returns the external object).} + \begin{nonnormative} + It follows that a function cannot return a component containing an external object, since only the constructor may return an external object and the constructor exactly returns the external object. + \end{nonnormative} \item External functions may be defined which operate on the internal memory of an \lstinline!ExternalObject!. An \lstinline!ExternalObject! used as input argument or