]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 30 Sep 2008 03:54:37 +0000 (22:54 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 30 Sep 2008 03:54:37 +0000 (22:54 -0500)
basis/furnace/actions/actions.factor
basis/locals/locals-docs.factor
basis/urls/encoding/encoding-docs.factor
basis/urls/encoding/encoding.factor
basis/urls/urls-tests.factor
basis/urls/urls.factor
core/syntax/syntax-docs.factor
extra/webapps/help/help.factor
extra/webapps/help/search.xml
extra/websites/concatenative/concatenative.factor

index 2a6348929941947b4eee98bccf1cf44875e01332..7505b3c6126f7588be4bdfc0fac0db318cb71546 100755 (executable)
@@ -79,7 +79,7 @@ TUPLE: action rest authorize init display validate submit ;
 \r
 : revalidate-url ( -- url/f )\r
     revalidate-url-key param\r
-    dup [ >url [ same-host? ] keep and ] when ;\r
+    dup [ >url ensure-port [ same-host? ] keep and ] when ;\r
 \r
 : validation-failed ( -- * )\r
     post-request? revalidate-url and [\r
index c07255547fac6b59c328f0e8911ee68f11315272..eb368936d408e0c7e3301a807d2a2ff9d2c04a3c 100644 (file)
@@ -65,7 +65,7 @@ HELP: [wlet
 
 HELP: ::
 { $syntax ":: word ( bindings... -- outputs... ) body... ;" }
-{ $description "Defines a word with named inputs; it reads stack values into bindings from left to right, then executes the body with those bindings in lexical scope. Any " { $link POSTPONE: [| } ", " { $link POSTPONE: [let } " or " { $link POSTPONE: [wlet } " forms used in the body of the word definition are automatically closure-converted." }
+{ $description "Defines a word with named inputs; it reads stack values into bindings from left to right, then executes the body with those bindings in lexical scope." }
 { $notes "The output names do not affect the word's behavior, however the compiler attempts to check the stack effect as with other definitions." }
 { $examples "See " { $link POSTPONE: [| } ", " { $link POSTPONE: [let } " and " { $link POSTPONE: [wlet } "." } ;
 
index 5ba94ea1bce658b56cb609782239ba95cf2b1b0e..f8b435441f7ecc749f5179e0204ce65d6694c356 100644 (file)
@@ -19,10 +19,10 @@ HELP: assoc>query
 { $notes "This word is used by the implementation of " { $link "urls" } ". It is also used by the HTTP client to encode POST requests." }
 { $examples
     { $example
-        "USING: io urls ;"
+        "USING: io urls.encoding ;"
         "{ { \"from\" \"Lead\" } { \"to\" \"Gold, please\" } }"
         "assoc>query print"
-        "from=Lead&to=Gold%2c+please"
+        "from=Lead&to=Gold%2c%20please"
     }
 } ;
 
@@ -32,7 +32,7 @@ HELP: query>assoc
 { $notes "This word is used by the implementation of " { $link "urls" } ". It is also used by the HTTP server to parse POST requests." }
 { $examples
     { $unchecked-example
-        "USING: prettyprint urls ;"
+        "USING: prettyprint urls.encoding ;"
         "\"gender=female&agefrom=22&ageto=28&location=Omaha+NE\""
         "query>assoc ."
         <" H{
index a4519c99b053424bf83f3cb7fb6066c29a293cda..fa882609a5c103724b07b8b7ef4dda84ff96fb31 100644 (file)
@@ -2,8 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel ascii combinators combinators.short-circuit
 sequences splitting fry namespaces make assocs arrays strings
-io.sockets io.sockets.secure io.encodings.string
-io.encodings.utf8 math math.parser accessors hashtables present ;
+io.encodings.string io.encodings.utf8 math math.parser accessors
+hashtables present ;
 IN: urls.encoding
 
 : url-quotable? ( ch -- ? )
index c98802657bdd92ecf5195c05dc6faf9041d65a7f..cac206bf3cc8cfe44e39c2c84a5e5c232411127e 100644 (file)
@@ -10,7 +10,6 @@ arrays kernel assocs present accessors ;
                 { host "www.apple.com" }
                 { port 1234 }
                 { path "/a/path" }
-                { raw-query "a=b" }
                 { query H{ { "a" "b" } } }
                 { anchor "foo" }
             }
@@ -21,7 +20,6 @@ arrays kernel assocs present accessors ;
                 { protocol "http" }
                 { host "www.apple.com" }
                 { path "/a/path" }
-                { raw-query "a=b" }
                 { query H{ { "a" "b" } } }
                 { anchor "foo" }
             }
@@ -59,7 +57,6 @@ arrays kernel assocs present accessors ;
         {
             T{ url
                 { path "bar" }
-                { raw-query "a=b" }
                 { query H{ { "a" "b" } } }
             }
             "bar?a=b"
@@ -213,7 +210,6 @@ urls [
     T{ url
         { protocol "http" }
         { host "localhost" }
-        { raw-query "foo=bar" }
         { query H{ { "foo" "bar" } } }
         { path "/" }
     }
@@ -224,7 +220,6 @@ urls [
     T{ url
         { protocol "http" }
         { host "localhost" }
-        { raw-query "foo=bar" }
         { query H{ { "foo" "bar" } } }
         { path "/" }
     }
index fb56e274da4f49215eb2b55ad4cf03adc7d0003c..5cc8c9693b50f7384a5ec566f13e652728324ef3 100644 (file)
@@ -8,7 +8,7 @@ strings.parser lexer prettyprint.backend hashtables present
 peg.ebnf urls.encoding ;
 IN: urls
 
-TUPLE: url protocol username password host port path raw-query query anchor ;
+TUPLE: url protocol username password host port path query anchor ;
 
 : <url> ( -- url ) url new ;
 
@@ -47,7 +47,7 @@ protocol = [a-z]+                   => [[ url-decode ]]
 username = [^/:@#?]+                => [[ url-decode ]]
 password = [^/:@#?]+                => [[ url-decode ]]
 pathname = [^#?]+                   => [[ url-decode ]]
-query    = [^#]+                    => [[ >string ]]
+query    = [^#]+                    => [[ query>assoc ]]
 anchor   = .+                       => [[ url-decode ]]
 
 hostname = [^/#?]+                  => [[ url-decode ]]
@@ -80,7 +80,7 @@ M: string >url
             ] [ f f f f f ] if*
         ]
         [ second ] ! pathname
-        [ third dup query>assoc ] ! query
+        [ third ] ! query
         [ fourth ] ! anchor
     } cleave url boa
     dup host>> [ [ "/" or ] change-path ] when ;
@@ -139,14 +139,14 @@ PRIVATE>
 
 : derive-url ( base url -- url' )
     [ clone ] dip over {
-        [ [ protocol>> ] either? >>protocol ]
-        [ [ username>> ] either? >>username ]
-        [ [ password>> ] either? >>password ]
-        [ [ host>>     ] either? >>host ]
-        [ [ port>>     ] either? >>port ]
-        [ [ path>>     ] bi@ swap url-append-path >>path ]
-        [ [ query>>    ] either? >>query ]
-        [ [ anchor>>   ] either? >>anchor ]
+        [ [ protocol>>  ] either? >>protocol ]
+        [ [ username>>  ] either? >>username ]
+        [ [ password>>  ] either? >>password ]
+        [ [ host>>      ] either? >>host ]
+        [ [ port>>      ] either? >>port ]
+        [ [ path>>      ] bi@ swap url-append-path >>path ]
+        [ [ query>>     ] either? >>query ]
+        [ [ anchor>>    ] either? >>anchor ]
     } 2cleave ;
 
 : relative-url ( url -- url' )
index 905cd87903720e537f9f98fb6c14aa3506584f9e..2b7de36d562b8f0bfdd796e474af463092740305 100755 (executable)
@@ -573,12 +573,12 @@ $nl
 } ;
 
 HELP: initial:
-{ $syntax "TUPLE: ... { \"slot\" initial: value } ... ;" }
+{ $syntax "TUPLE: ... { slot initial: value } ... ;" }
 { $values { "slot" "a slot name" } { "value" "any literal" } }
 { $description "Specifies an initial value for a tuple slot." } ;
 
 HELP: read-only
-{ $syntax "TUPLE: ... { \"slot\" read-only } ... ;" }
+{ $syntax "TUPLE: ... { slot read-only } ... ;" }
 { $values { "slot" "a slot name" } }
 { $description "Defines a tuple slot to be read-only. If a tuple has read-only slots, instances of the tuple should only be created by calling " { $link boa } ", instead of " { $link new } ". Using " { $link boa } " is the only way to set the value of a read-only slot." } ;
 
index e9b6a4863480513f4132f1c64919f9f486321a91..c209fe222e6eb0fb13e30927828463894000adfd 100644 (file)
@@ -13,7 +13,7 @@ TUPLE: help-webapp < dispatcher ;
 
         [
             {
-                { "search" [ 2 v-min-length 50 v-max-length v-one-line ] }
+                { "search" [ 1 v-min-length 50 v-max-length v-one-line ] }
             } validate-params
 
             help-dir set-current-directory
index 8335725ce5a070d27266f6c13dcb859b7acb46c3..e5fa5d3901a5128c34d4a2f1565b1f1fadba1581 100644 (file)
 
                <p>This is the <a href="http://factorcode.org" target="_top">Factor</a>
                documentation, generated offline from a
-               <code>load-everything</code> image. The Factor UI also
-               includes a documentation browser tool.</p>
+               <code>load-everything</code> image. If you want, you can also browse the
+               documentation from within the <a href="http://factorcode.org" target="_top">Factor</a> UI.</p>
                
-               <p>You may search article titles below.</p>
+               <p>You may search article titles below; for example, try searching for "HTTP".</p>
                
                <t:form t:action="$help-webapp/search">
                        <t:field t:name="search" />
index 72eb48306653a2b89cee05ae472d10a76139b0d2..0af8eb31d7aa5d68a5da4c492ef86a8938747aa6 100644 (file)
@@ -77,10 +77,9 @@ SYMBOL: dh-file
     "password" key-password set-global
     common-configuration
     <factor-website>
-        <pastebin> "pastebin" add-responder
-        <planet> "planet" add-responder
+        <pastebin> <factor-boilerplate> "pastebin" add-responder
+        <planet> <factor-boilerplate> "planet" add-responder
         "/tmp/docs/" <help-webapp> "docs" add-responder
-    <factor-boilerplate>
     <configuration>
     main-responder set-global ;