|
|
|
|
|
by TeMPOraL
389 days ago
|
|
Restarts in CLHS are blocks of code handling a condition (exception). CL splits the "catch exception" and "react to it" parts into handlers and restarts. The two are independent; a handler can choose any restart currently installed above it in the call stack, or ask the user to choose interactively; the stack is only unwinded up to the point of a restart to resume from. This means you could e.g. following call stack: 5. Code that signals a file read error 4. Code that installs restarts "re-read line" and "skip line" 3. Code that loops over files in line 2. Code that installs restart "re-read file" or "abort" 1. Code with the handler that intelligently chooses whether to resume from 4 by re-reading a line or skipping it, or resume from 2 by attempting to read the file again, or just bailing out. |
|