Ignore:
Timestamp:
Sep 20, 2021, 11:46:19 AM (3 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
6cc87c0
Parents:
432bffe
Message:

Andrew MMath: Removed (updated one) the remaining \todo items.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/andrew_beach_MMath/features.tex

    r432bffe r6aa84e0  
    129129\section{Virtuals}
    130130\label{s:virtuals}
    131 %\todo{Maybe explain what "virtual" actually means.}
     131A common feature in many programming languages is a tool to pair code
     132(behaviour) with data.
     133In \CFA this is done with the virtual system,
     134which allow type information to be abstracted away, recovered and allow
     135operations to be performed on the abstract objects.
     136
    132137Virtual types and casts are not part of \CFA's EHM nor are they required for
    133138an EHM.
     
    488493Since it is so general, a more specific handler can be defined,
    489494overriding the default behaviour for the specific exception types.
    490 %\todo{Examples?}
     495
     496For example, consider an error reading a configuration file.
     497This is most likely a problem with the configuration file @config_error@,
     498but the function could have been passed the wrong file name @arg_error@.
     499In this case the function could raise one exception and then, if it is
     500unhandled, raise the other.
     501This is not usual behaviour for either exception so changing the
     502default handler will be done locally:
     503\begin{cfa}
     504{
     505        void defaultTerminationHandler(config_error &) {
     506                throw (arg_error){arg_vt};
     507        }
     508        throw (config_error){config_vt};
     509}
     510\end{cfa}
    491511
    492512\subsection{Resumption}
     
    551571the just handled exception came from, and continues executing after it,
    552572not after the try statement.
    553 %\todo{Examples?}
     573
     574For instance, a resumption used to send messages to the logger may not
     575need to be handled at all. Putting the following default handler
     576at the global scope can make handling the exception optional by default.
     577\begin{cfa}
     578void defaultResumptionHandler(log_message &) {
     579    // Nothing, it is fine not to handle logging.
     580}
     581// ... No change at raise sites. ...
     582throwResume (log_message){strlit_log, "Begin event processing."}
     583\end{cfa}
    554584
    555585\subsubsection{Resumption Marking}
Note: See TracChangeset for help on using the changeset viewer.