From 8d805d3dcb139303c333e580f67f82bfb3af3545 Mon Sep 17 00:00:00 2001 From: Chris Double Date: Sun, 18 Sep 2005 05:55:18 +0000 Subject: [PATCH] Get cont-responder contrib examples working again, and more fixes to cont-responder for continuation word changes. --- contrib/cont-responder/eval-responder.factor | 2 ++ library/httpd/cont-responder.factor | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/contrib/cont-responder/eval-responder.factor b/contrib/cont-responder/eval-responder.factor index b50e244a6b..cabd32c413 100644 --- a/contrib/cont-responder/eval-responder.factor +++ b/contrib/cont-responder/eval-responder.factor @@ -174,6 +174,8 @@ USE: sequences "eval" get ] bind ; +: >pop> dup pop* ; + : infra ( list quot -- list ) #! Call the quotation using 'list' as the datastack #! return the result datastack as a list. diff --git a/library/httpd/cont-responder.factor b/library/httpd/cont-responder.factor index dea48b2a77..7e4a1d99ea 100644 --- a/library/httpd/cont-responder.factor +++ b/library/httpd/cont-responder.factor @@ -43,14 +43,18 @@ SYMBOL: post-refresh-get? [ 32 [ 0 9 random-int CHAR: 0 + , ] times ] "" make string>number 36 >base ; +SYMBOL: table + : continuation-table ( -- ) #! Return the global table of continuations - {{ }} ; + table global hash ; : reset-continuation-table ( -- ) #! Create the initial global table continuation-table hash-clear ; +{{ }} clone table global set-hash + #! Tuple for holding data related to a continuation. TUPLE: item expire? quot id time-added ; @@ -190,7 +194,7 @@ SYMBOL: callback-cc continue ] callcc1 ( 0 [ ] == ) nip - continue + call store-callback-cc ] callcc0 ;