From d31d1eebaed7f4a25e3b37b2aef583758062256f Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Fri, 14 Sep 2012 14:59:38 -0700 Subject: [PATCH] continuations: slight speedup. --- core/continuations/continuations.factor | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/continuations/continuations.factor b/core/continuations/continuations.factor index 0d0c41c72d..65fe51182e 100644 --- a/core/continuations/continuations.factor +++ b/core/continuations/continuations.factor @@ -45,8 +45,11 @@ C: continuation 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 ( error restarts cc -- condition ) +C: condition : throw-restarts ( error restarts -- restart ) [ throw ] callcc1 2nip ; -- 2.34.1