continuations: rename catchstack* to (get-catchstack) for consistency.

db4
John Benediktsson 2015-08-13 17:52:40 -07:00
parent f88febc03e
commit bee46baecb
2 changed files with 6 additions and 6 deletions

View File

@ -108,7 +108,7 @@ $nl
ABOUT: "continuations"
HELP: catchstack*
HELP: (get-catchstack)
{ $values { "catchstack" "a vector of continuations" } }
{ $description "Outputs the current catchstack." } ;

View File

@ -19,14 +19,14 @@ SYMBOL: restarts
<PRIVATE
: catchstack* ( -- catchstack )
: (get-catchstack) ( -- catchstack )
CONTEXT-OBJ-CATCHSTACK context-object { vector } declare ; inline
! We have to defeat some optimizations to make continuations work
: dummy-1 ( -- obj ) f ;
: dummy-2 ( obj -- obj ) ;
: get-catchstack ( -- catchstack ) catchstack* clone ; inline
: get-catchstack ( -- catchstack ) (get-catchstack) clone ; inline
: (set-catchstack) ( catchstack -- )
CONTEXT-OBJ-CATCHSTACK set-context-object ; inline
@ -132,7 +132,7 @@ callback-error-hook [ [ die ] ] initialize
: rethrow ( error -- * )
dup save-error
catchstack* [
(get-catchstack) [
in-callback?
[ callback-error-hook get-global call( error -- * ) ]
[ OBJ-CURRENT-THREAD special-object error-in-thread ]
@ -142,9 +142,9 @@ callback-error-hook [ [ die ] ] initialize
: recover ( ..a try: ( ..a -- ..b ) recovery: ( ..a error -- ..b ) -- ..b )
[
[
[ catchstack* push ] dip
[ (get-catchstack) push ] dip
call
catchstack* pop*
(get-catchstack) pop*
] curry
] dip ifcc ; inline