Get cont-responder examples working with 0.77 word changes. eval-responder is
currently broken though.cvs
parent
a21a630087
commit
06806ec8cc
|
@ -69,7 +69,7 @@ USE: namespaces
|
||||||
</form>
|
</form>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
] show [ "num" get ] bind str>number ;
|
] show [ "num" get ] bind string>number ;
|
||||||
|
|
||||||
: guess-banner
|
: guess-banner
|
||||||
"I'm thinking of a number between 0 and 100." web-print ;
|
"I'm thinking of a number between 0 and 100." web-print ;
|
||||||
|
|
|
@ -94,10 +94,10 @@ USE: io
|
||||||
#! Create a namespace holding data required
|
#! Create a namespace holding data required
|
||||||
#! for testing continuation based responder functions
|
#! for testing continuation based responder functions
|
||||||
#! at the interpreter console.
|
#! at the interpreter console.
|
||||||
<namespace> [
|
[
|
||||||
reset-continuation-table
|
reset-continuation-table
|
||||||
init-session-namespace
|
init-session-namespace
|
||||||
] extend ;
|
] make-hash ;
|
||||||
|
|
||||||
: test-cont-function ( <state> quot -- <state> )
|
: test-cont-function ( <state> quot -- <state> )
|
||||||
#! Call a continuation responder function with required
|
#! Call a continuation responder function with required
|
||||||
|
|
|
@ -46,11 +46,11 @@ USE: sequences
|
||||||
#! Create an 'evaluator' object that holds
|
#! Create an 'evaluator' object that holds
|
||||||
#! the current stack, output and history for
|
#! the current stack, output and history for
|
||||||
#! do-eval.
|
#! do-eval.
|
||||||
<namespace> [
|
[
|
||||||
"history" set
|
"history" set
|
||||||
"output" set
|
"output" set
|
||||||
"stack" set
|
"stack" set
|
||||||
] extend ;
|
] make-hash ;
|
||||||
|
|
||||||
: display-eval-form ( url -- )
|
: display-eval-form ( url -- )
|
||||||
#! Display the components for allowing entry of
|
#! Display the components for allowing entry of
|
||||||
|
|
|
@ -57,7 +57,7 @@ USE: prettyprint
|
||||||
<body>
|
<body>
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
"millis" [ millis prettyprint ] "Display Server millis" live-anchor
|
"millis" [ millis pprint ] "Display Server millis" live-anchor
|
||||||
<div id= "millis" div>
|
<div id= "millis" div>
|
||||||
"The millisecond time from the server will appear here" write
|
"The millisecond time from the server will appear here" write
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -71,10 +71,10 @@ USE: lists
|
||||||
#! fragment which is the output generated by calling
|
#! fragment which is the output generated by calling
|
||||||
#! 'quot'. That HTML fragment will be wrapped in a
|
#! 'quot'. That HTML fragment will be wrapped in a
|
||||||
#! 'div' with the given id.
|
#! 'div' with the given id.
|
||||||
<namespace> [
|
[
|
||||||
"div-quot" set
|
"div-quot" set
|
||||||
"div-id" set
|
"div-id" set
|
||||||
] extend [
|
] make-hash [
|
||||||
[
|
[
|
||||||
t "disable-initial-redirect?" set
|
t "disable-initial-redirect?" set
|
||||||
[
|
[
|
||||||
|
@ -123,10 +123,10 @@ USE: lists
|
||||||
#! 'div' with the given id. The 'quot' is called with
|
#! 'div' with the given id. The 'quot' is called with
|
||||||
#! a string on top of the stack. This is the input string
|
#! a string on top of the stack. This is the input string
|
||||||
#! entered in the live search input box.
|
#! entered in the live search input box.
|
||||||
<namespace> [
|
[
|
||||||
"div-quot" set
|
"div-quot" set
|
||||||
"div-id" set
|
"div-id" set
|
||||||
] extend [
|
] make-hash [
|
||||||
[
|
[
|
||||||
t "disable-initial-redirect?" set
|
t "disable-initial-redirect?" set
|
||||||
#! Retrieve the search query value from the POST parameters.
|
#! Retrieve the search query value from the POST parameters.
|
||||||
|
|
|
@ -452,7 +452,7 @@ USE: sequences
|
||||||
#! Write the table of items for the todo list.
|
#! Write the table of items for the todo list.
|
||||||
<table>
|
<table>
|
||||||
"heading" [
|
"heading" [
|
||||||
[ "Priority" write ] [ "Complete?" write ] [ "Description" write ] [ "Action" write ] [ bl ]
|
[ "Priority" write ] [ "Complete?" write ] [ "Description" write ] [ "Action" write ] [ " " write ]
|
||||||
] styled-row
|
] styled-row
|
||||||
todo-items [ write-item-row ] each
|
todo-items [ write-item-row ] each
|
||||||
</table> ;
|
</table> ;
|
||||||
|
|
|
@ -40,19 +40,19 @@ USE: unparser
|
||||||
|
|
||||||
: <todo> ( user password -- <todo> )
|
: <todo> ( user password -- <todo> )
|
||||||
#! Create an empty todo list
|
#! Create an empty todo list
|
||||||
<namespace> [
|
[
|
||||||
"password" set
|
"password" set
|
||||||
"user" set
|
"user" set
|
||||||
f "items" set
|
f "items" set
|
||||||
] extend ;
|
] make-hash ;
|
||||||
|
|
||||||
: <todo-item> ( priority description -- )
|
: <todo-item> ( priority description -- )
|
||||||
#! Create a todo item
|
#! Create a todo item
|
||||||
<namespace> [
|
[
|
||||||
"description" set
|
"description" set
|
||||||
"priority" set
|
"priority" set
|
||||||
f "complete?" set
|
f "complete?" set
|
||||||
] extend ;
|
] make-hash ;
|
||||||
|
|
||||||
: add-todo-item ( <todo> <item> -- )
|
: add-todo-item ( <todo> <item> -- )
|
||||||
#! Add the item to the todo list
|
#! Add the item to the todo list
|
||||||
|
@ -95,13 +95,13 @@ USE: unparser
|
||||||
: read-todo ( -- <todo> )
|
: read-todo ( -- <todo> )
|
||||||
#! Read a todo list from the current input stream.
|
#! Read a todo list from the current input stream.
|
||||||
readln url-decode readln url-decode <todo>
|
readln url-decode readln url-decode <todo>
|
||||||
readln str>number [
|
readln string>number [
|
||||||
dup
|
dup
|
||||||
<namespace> [
|
[
|
||||||
readln url-decode "yes" = "complete?" set
|
readln url-decode "yes" = "complete?" set
|
||||||
readln url-decode "priority" set
|
readln url-decode "priority" set
|
||||||
readln url-decode "description" set
|
readln url-decode "description" set
|
||||||
] extend add-todo-item
|
] make-hash add-todo-item
|
||||||
] times ;
|
] times ;
|
||||||
|
|
||||||
: load-todo ( filename -- <todo> )
|
: load-todo ( filename -- <todo> )
|
||||||
|
|
Loading…
Reference in New Issue