]> gitweb.factorcode.org Git - factor.git/commitdiff
Get cont-responder examples working with 0.77 word changes. eval-responder is
authorChris Double <chris.double@double.co.nz>
Tue, 23 Aug 2005 23:49:52 +0000 (23:49 +0000)
committerChris Double <chris.double@double.co.nz>
Tue, 23 Aug 2005 23:49:52 +0000 (23:49 +0000)
currently broken though.

contrib/cont-responder/cont-numbers-game.factor
contrib/cont-responder/cont-testing.factor
contrib/cont-responder/eval-responder.factor
contrib/cont-responder/live-updater-responder.factor
contrib/cont-responder/live-updater.factor
contrib/cont-responder/todo-example.factor
contrib/cont-responder/todo.factor

index 469a510931a0685f133b48e18aa46ff2aff74601..62e2474d250eae94ff9e0af7d4595f18b89ee56b 100644 (file)
@@ -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 ;
index 5316f875894421523eb7641934106176d982e381..7e78e27cfa8059f757c1aa405988d6c9db8ad7a1 100644 (file)
@@ -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
index d0bfa814cb7768dda0abfa117e788da81fcbc0aa..eb3247e29e269701f6f06d71bc35d93597fe8622 100644 (file)
@@ -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 
index db498ac73c9826fcec66e23f5d3a6b887a05c939..b409a0541eb8071dc5b9e87a43ace85046071f4c 100644 (file)
@@ -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>         
index d4355948cd12ced714d744469b18bed230039156..d777e18d0a9efcdbdf85a062fcd917804561fd21 100644 (file)
@@ -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.
index 128dc80900bf6e81015fa6d3922ddd052ae41f42..0fb1f2794e0dae6bae7274344235a558fd1e48ad 100644 (file)
@@ -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> ;
index a51f420cab7c229cf33f1d8d855d9c3b34009234..7b08bb2ea40f4cffc56664c411b16e7b4a781c30 100644 (file)
@@ -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> )