compute-restarts ( error -- seq ) - Factor Documentation

compute-restarts ( error -- seq )


Vocabulary
continuations

Inputs
error an object


Outputs
seq a 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 continues 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 fixups kernel lexer namespaces
sequences ;

M: lexer-error compute-restarts
[ error-continuation get swap compute-fixups ]
[ error>> compute-restarts ] bi append ;


USING: continuations kernel ;

M: object compute-restarts drop { } ;


USING: accessors continuations source-files.errors ;

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

AltStyle によって変換されたページ (->オリジナル) /