currently broken though.
</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 ;
#! 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
#! 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
<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>
#! 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
[
#! '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.
#! 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> ;
: <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
: 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> )