From 2b225a6c7bcd5b978affecdb127e7ee3dac4b89a Mon Sep 17 00:00:00 2001 From: Chris Double Date: Mon, 7 Feb 2005 00:08:14 +0000 Subject: [PATCH] Changes to cont-responder to work with recent Factor changes (string-output instead of string-output-stream, new cons format, etc). --- contrib/cont-responder/browser.factor | 3 ++- contrib/cont-responder/cont-responder.factor | 2 +- contrib/cont-responder/eval-responder.factor | 4 ++-- contrib/cont-responder/live-updater.factor | 2 +- contrib/cont-responder/todo.factor | 4 ++-- contrib/cont-responder/tutorial.txt | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/contrib/cont-responder/browser.factor b/contrib/cont-responder/browser.factor index c0525142b1..db7c92df5d 100644 --- a/contrib/cont-responder/browser.factor +++ b/contrib/cont-responder/browser.factor @@ -86,7 +86,7 @@ USE: listener : write-editable-word-source ( vocab word -- ) #! Write the source in a manner allowing it to be edited.
@@ -224,3 +224,4 @@ USE: listener "browser" f browse ; "browser" [ f browser-responder ] install-cont-responder +!"browser-edit" [ t browser-responder ] install-cont-responder diff --git a/contrib/cont-responder/cont-responder.factor b/contrib/cont-responder/cont-responder.factor index a8f0163928..410123a47d 100644 --- a/contrib/cont-responder/cont-responder.factor +++ b/contrib/cont-responder/cont-responder.factor @@ -193,7 +193,7 @@ DEFER: show : with-string-stream ( quot -- string ) #! Call the quotation with standard output bound to a string output #! stream. Return the string on exit. - 1024 dup >r swap with-stream r> stream>str ; + 1024 dup >r swap with-stream r> stream>str ; : redirect-to-here ( -- ) #! Force a redirect to the client browser so that the browser diff --git a/contrib/cont-responder/eval-responder.factor b/contrib/cont-responder/eval-responder.factor index 41e9651aad..b769f95779 100644 --- a/contrib/cont-responder/eval-responder.factor +++ b/contrib/cont-responder/eval-responder.factor @@ -73,7 +73,7 @@ USE: logging : escape-quotes ( string -- string ) #! Replace occurrences of single quotes with #! backslash quote. - [ dup [ [ CHAR: ' | "\\'" ] [ CHAR: " | "\\\"" ] ] assoc dup rot ? ] str-map ; + [ dup [ [[ CHAR: ' "\\'" ]] [[ CHAR: " "\\\"" ]] ] assoc dup rot ? ] str-map ; : make-eval-javascript ( string -- string ) #! Give a string return some javascript that when @@ -187,7 +187,7 @@ USE: logging #! callstack along with the resulting datastack as a list. [ "inspect" "responder" set - 1024 dup >r [ + 1024 dup >r [ do-eval ] with-stream r> stream>str ] bind ; diff --git a/contrib/cont-responder/live-updater.factor b/contrib/cont-responder/live-updater.factor index ec38599582..40a36c9bd6 100644 --- a/contrib/cont-responder/live-updater.factor +++ b/contrib/cont-responder/live-updater.factor @@ -39,7 +39,7 @@ USE: lists : get-live-updater-js ( filename -- string ) #! Return the liveUpdater javascript code as a string. - [ get-live-updater-js* ] make-string ; + [ get-live-updater-js* ] make-string ; : live-updater-url ( -- url ) #! Generate an URL to the liveUpdater.js code. diff --git a/contrib/cont-responder/todo.factor b/contrib/cont-responder/todo.factor index a773320a35..063cadc975 100644 --- a/contrib/cont-responder/todo.factor +++ b/contrib/cont-responder/todo.factor @@ -91,7 +91,7 @@ USE: hashtables : store-todo ( filename -- ) #! store the todo list in the given file. - [ write-todo ] with-stream ; + [ write-todo ] with-stream ; : read-todo ( -- ) #! Read a todo list from the current input stream. @@ -106,7 +106,7 @@ USE: hashtables ] times ; : load-todo ( filename -- ) - [ read-todo ] with-stream ; + [ read-todo ] with-stream ; : password-matches? ( password -- ) #! Returns the if the password matches otherwise diff --git a/contrib/cont-responder/tutorial.txt b/contrib/cont-responder/tutorial.txt index dae16542f7..7373c464b0 100644 --- a/contrib/cont-responder/tutorial.txt +++ b/contrib/cont-responder/tutorial.txt @@ -152,7 +152,7 @@ Dynamic Data ============ Adding dynamic data to the page is relatively easy. This example pulls -a information from the 'room' word which displays memory details about +information from the 'room' word which displays memory details about the running Factor system. It also uses 'room.' which outputs these details to standard output and this is wrapped in a
 tag so it is
 formatted correctly.