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