Changeset 6071efc for doc/theses/andrew_beach_MMath/features.tex
- Timestamp:
- Jun 16, 2021, 10:44:22 AM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- edebbf7
- Parents:
- b51e389c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/features.tex
rb51e389c r6071efc 13 13 \subsection{Raise / Handle} 14 14 An exception operation has two main parts: raise and handle. 15 These terms are sometimes alsoknown as throw and catch but this work uses15 These terms are sometimes known as throw and catch but this work uses 16 16 throw/catch as a particular kind of raise/handle. 17 17 These are the two parts that the user writes and may … … 37 37 Only raises inside the guarded region and raising exceptions that match the 38 38 label can be handled by a given handler. 39 Different EHMs use different rules to pick a handler,40 if multiple handlers could be usedsuch as ``best match" or ``first found".39 If multiple handlers could can handle an exception, 40 EHMs will define a rule to pick one, such as ``best match" or ``first found". 41 41 42 42 The @try@ statements of \Cpp, Java and Python are common examples. All three … … 74 74 case when stack unwinding is involved. 75 75 76 If a matching handler is not guarant ied to be found, the EHM needs a76 If a matching handler is not guaranteed to be found, the EHM needs a 77 77 different course of action for the case where no handler matches. 78 78 This situation only occurs with unchecked exceptions as checked exceptions … … 105 105 106 106 \subsection{Completion} 107 After the handler has finished the entire exception operation has to complete107 After the handler has finished, the entire exception operation has to complete 108 108 and continue executing somewhere else. This step is usually simple, 109 109 both logically and in its implementation, as the installation of the handler … … 126 126 Virtual types and casts are not part of \CFA's EHM nor are they required for 127 127 any EHM. 128 However, it is one of the best ways to support an exception hiera chy128 However, it is one of the best ways to support an exception hierarchy 129 129 is via a virtual hierarchy and dispatch system. 130 130 … … 441 441 There is a global \defaultResumptionHandler{} is polymorphic over all 442 442 resumption exceptions and preforms a termination throw on the exception. 443 The \defaultTerminationHandler{} can be overrid en by providing a new443 The \defaultTerminationHandler{} can be overridden by providing a new 444 444 function that is a better match. 445 445 … … 582 582 Two things can expose differences between these cases. 583 583 584 One is the exist ance of multiple handlers on a single try statement.584 One is the existence of multiple handlers on a single try statement. 585 585 A reraise skips all later handlers on this try statement but a conditional 586 586 catch does not. … … 588 588 implicitly skipped, with a conditional catch they are not. 589 589 Still, they are equivalently powerful, 590 both can be used two mimic kthe behaviour of the other,590 both can be used two mimic the behaviour of the other, 591 591 as reraise can pack arbitrary code in the handler and conditional catches 592 592 can put arbitrary code in the predicate. 593 % I was struggling with a long expl ination about some simple solutions,593 % I was struggling with a long explanation about some simple solutions, 594 594 % like repeating a condition on later handlers, and the general solution of 595 595 % merging everything together. I don't think it is useful though unless its
Note: See TracChangeset
for help on using the changeset viewer.