concept-exits.tex 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. % -*- Mode: TeX -*-
  2. %% Exit Extents
  3. % This text was originally duplicated in each of GO, RETURN-FROM,
  4. % and THROW. I thought it would be less redundant to centralize it here.
  5. % --sjl 7 Mar 92
  6. \issue{EXIT-EXTENT:MINIMAL}
  7. When a transfer of control is initiated by \specref{go},
  8. \specref{return-from}, or \specref{throw}
  9. the following events occur in order to accomplish the transfer of control.
  10. Note that for \specref{go},
  11. the \term{exit point} is the \term{form} within the \specref{tagbody}
  12. that is being executed at the time the \specref{go} is performed;
  13. for \specref{return-from},
  14. the \term{exit point} is the corresponding
  15. \specref{block} \term{form};
  16. and for \specref{throw},
  17. the \term{exit point} is the corresponding
  18. \specref{catch} \term{form}.
  19. \beginlist
  20. \itemitem{1.}
  21. Intervening \term{exit points} are ``abandoned''
  22. (\ie their \term{extent} ends
  23. and it is no longer valid to attempt to transfer control through them).
  24. \itemitem{2.}
  25. The cleanup clauses of any intervening \specref{unwind-protect} clauses
  26. are evaluated.
  27. \itemitem{3.}
  28. % added condition handlers and restarts -- sjl 7 Mar 92
  29. Intervening dynamic \term{bindings} of \declref{special} variables,
  30. \term{catch tags}, \term{condition handlers}, and \term{restarts}
  31. are undone.
  32. \itemitem{4.}
  33. The \term{extent} of the \term{exit point} being invoked ends,
  34. and control is passed to the target.
  35. \endlist
  36. The extent of an exit being ``abandoned'' because it is being passed over
  37. ends as soon as the transfer of control is initiated. That is,
  38. event 1 occurs at the beginning of the initiation of the transfer of
  39. control.
  40. The consequences are undefined if an attempt is made to transfer control
  41. to an \term{exit point} whose \term{dynamic extent} has ended.
  42. %Moon had me add the part about "interleaved" -kmp 13-Feb-92
  43. Events 2 and 3 are actually performed interleaved, in the order
  44. corresponding to the reverse order in which they were established.
  45. The effect of this is that the cleanup clauses of an \specref{unwind-protect}
  46. see the same dynamic \term{bindings}
  47. of variables and \term{catch tags} as were
  48. visible when the \specref{unwind-protect} was entered.
  49. Event 4 occurs at the end of the transfer of control.
  50. \endissue{EXIT-EXTENT:MINIMAL}