continuations: slight speedup.

db4
John Benediktsson 2012-09-14 14:59:38 -07:00
parent a206daacde
commit d31d1eebae
1 changed files with 5 additions and 2 deletions

View File

@ -45,8 +45,11 @@ C: <continuation> continuation
<PRIVATE
ERROR: not-a-continuation obj ;
: >continuation< ( continuation -- data call retain name catch )
{ [ data>> ] [ call>> ] [ retain>> ] [ name>> ] [ catch>> ] } cleave ;
dup continuation? [ not-a-continuation ] unless
{ [ data>> ] [ call>> ] [ retain>> ] [ name>> ] [ catch>> ] } cleave ; inline
PRIVATE>
@ -160,7 +163,7 @@ ERROR: attempt-all-error ;
TUPLE: condition error restarts continuation ;
C: <condition> condition ( error restarts cc -- condition )
C: <condition> condition
: throw-restarts ( error restarts -- restart )
[ <condition> throw ] callcc1 2nip ;