compute-restarts ( error -- seq )


Vocabulary
continuations

Inputs and outputs
erroran object
seqa sequence


Word description
Outputs a sequence of triples, where each triple consists of a human-readable string, an object, and a continuation. Resuming a continuation with the corresponding object restarts execution immediately after the corresponding call to condition.

This word recursively travels up the delegation chain to collate restarts from nested and wrapped conditions.

Definition
IN: continuations

GENERIC: compute-restarts ( error -- seq )


Methods
USING: accessors assocs continuations kernel sequences ;

M: condition compute-restarts
[ error>> compute-restarts ] [
[ restarts>> ] [ continuation>> [ <restart> ] curry ]
bi { } assoc>map
] bi append ;


USING: accessors continuations lexer ;

M: lexer-error compute-restarts error>> compute-restarts ;


USING: continuations kernel ;

M: object compute-restarts drop { } ;


USING: accessors continuations source-files.errors ;

M: source-file-error compute-restarts
error>> compute-restarts ;