]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 26 Feb 2011 17:44:50 +0000 (11:44 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sat, 26 Feb 2011 17:44:50 +0000 (11:44 -0600)
41 files changed:
basis/colors/hex/hex-docs.factor
basis/combinators/random/random-docs.factor
basis/compiler/cfg/ssa/construction/tdmsc/tdmsc-tests.factor
basis/concurrency/distributed/distributed-docs.factor
basis/environment/environment-docs.factor
basis/help/topics/topics-docs.factor
basis/http/http-docs.factor
basis/io/encodings/8-bit/latin9/latin9-docs.factor
basis/io/encodings/shift-jis/shift-jis-docs.factor
basis/io/sockets/icmp/icmp.factor
basis/io/sockets/secure/unix/unix-tests.factor
basis/io/sockets/sockets-docs.factor
basis/io/sockets/sockets-tests.factor
basis/io/sockets/sockets.factor
basis/io/styles/styles-docs.factor
basis/lists/lists-docs.factor
basis/locals/locals-docs.factor
basis/macros/macros-docs.factor
basis/math/combinatorics/combinatorics-docs.factor
basis/math/vectors/vectors-docs.factor
basis/peg/ebnf/ebnf-docs.factor
basis/stack-checker/stack-checker-docs.factor
basis/tools/deploy/deploy-tests.factor
basis/tools/deploy/test/21/21.factor [new file with mode: 0644]
basis/tools/deploy/test/21/deploy.factor [new file with mode: 0644]
basis/tools/dns/authors.txt [deleted file]
basis/tools/dns/dns.factor [deleted file]
basis/ui/tools/listener/listener-docs.factor
core/assocs/assocs-docs.factor
core/classes/classes-docs.factor
core/combinators/combinators-docs.factor
core/continuations/continuations-docs.factor
core/definitions/definitions-docs.factor
core/syntax/syntax-docs.factor
core/words/words-docs.factor
extra/bunny/model/model.factor
extra/dns/dns.factor
extra/gpu/demos/bunny/bunny.factor
extra/images/viewer/viewer-docs.factor
extra/tools/dns/authors.txt [new file with mode: 0644]
extra/tools/dns/dns.factor [new file with mode: 0644]

index ca496922009745dfc75753958b9a01183ccdde60..9f67875da2984132607c4b0ca411fd2b63a273ba 100644 (file)
@@ -27,7 +27,7 @@ HELP: HEXCOLOR:
 
 ARTICLE: "colors.hex" "HEX colors"
 "The " { $vocab-link "colors.hex" } " vocabulary implements colors specified "
-"by their hexidecimal value."
+"by their hexadecimal value."
 { $subsections
     hex>rgba
     rgba>hex
index 2fc0b8c00ecba016a65b40fb8b6fe077e4e14150..826474420c9017b2933ef3ceecbc5e174403e8d1 100644 (file)
@@ -32,17 +32,21 @@ HELP: casep
 { $examples
     "The following two forms will output 1 with 0.2 probability, 2 with 0.3 probability and 3 with 0.5 probability"
     { $code
-        "USING: combinators.random ;"
-        "{ { 0.2 [ 1 ] }"
-        "  { 0.3 [ 2 ] }"
-        "  { 0.5 [ 3 ] } } casep ."
+        "USING: combinators.random prettyprint ;"
+        "{"
+        "    { 0.2 [ 1 ] }"
+        "    { 0.3 [ 2 ] }"
+        "    { 0.5 [ 3 ] }"
+        "} casep ."
     }
     $nl
     { $code
-        "USING: combinators.random ;"
-        "{ { 0.2 [ 1 ] }"
-        "  { 0.3 [ 2 ] }"
-        "  { [ 3 ] } } casep ."
+        "USING: combinators.random prettyprint ;"
+        "{"
+        "    { 0.2 [ 1 ] }"
+        "    { 0.3 [ 2 ] }"
+        "    [ 3 ]"
+        "} casep ."
     }
 
 }
@@ -62,17 +66,21 @@ HELP: casep*
 { $examples
     "The following two forms will output 1 with 0.5 probability, 2 with 0.25 probability and 3 with 0.25 probability"
     { $code
-        "USING: combinators.random ;"
-        "{ { 0.5 [ 1 ] }"
-        "  { 0.5 [ 2 ] }"
-        "  { 1 [ 3 ] } } casep* ."
+        "USING: combinators.random prettyprint ;"
+        "{"
+        "    { 0.5 [ 1 ] }"
+        "    { 0.5 [ 2 ] }"
+        "    { 1 [ 3 ] }"
+        "} casep* ."
     }
     $nl
     { $code
-        "USING: combinators.random ;"
-        "{ { 0.5 [ 1 ] }"
-        "  { 0.5 [ 2 ] }"
-        "  { [ 3 ] } } casep* ."
+        "USING: combinators.random prettyprint ;"
+        "{"
+        "    { 0.5 [ 1 ] }"
+        "    { 0.5 [ 2 ] }"
+        "    [ 3 ]"
+        "} casep* ."
     }
 
 }
index 9b24c55078c81122c72127a0cd2496417479224a..2b80ce9d591b4385704f2a83bc18c8be394ed48f 100644 (file)
@@ -24,10 +24,10 @@ V{ } 5 test-bb
 
 [ ] [ test-tdmsc ] unit-test
 
-[ V{ 4 } ] [ 1 get 1array merge-set [ number>> ] map ] unit-test
-[ V{ 4 } ] [ 2 get 1array merge-set [ number>> ] map ] unit-test
-[ V{ } ] [ 0 get 1array merge-set ] unit-test
-[ V{ } ] [ 4 get 1array merge-set ] unit-test
+[ { 4 } ] [ 1 get 1array merge-set [ number>> ] map ] unit-test
+[ { 4 } ] [ 2 get 1array merge-set [ number>> ] map ] unit-test
+[ { } ] [ 0 get 1array merge-set ] unit-test
+[ { } ] [ 4 get 1array merge-set ] unit-test
 
 V{ } 0 test-bb
 V{ } 1 test-bb
@@ -70,5 +70,5 @@ V{ } 7 test-bb
 
 [ ] [ test-tdmsc ] unit-test
 
-[ V{ 2 } ] [ { 2 3 4 5 } [ get ] map merge-set [ number>> ] map ] unit-test
-[ V{ } ] [ { 0 1 6 7 } [ get ] map merge-set ] unit-test
+[ { 2 } ] [ { 2 3 4 5 } [ get ] map merge-set [ number>> ] map ] unit-test
+[ { } ] [ { 0 1 6 7 } [ get ] map merge-set ] unit-test
index 80e07027cec2e41c0baa394bc7959f0df6bc7060..19cfef88723975ea504b2f6605efea283f60f847 100644 (file)
@@ -4,7 +4,7 @@ IN: concurrency.distributed
 ARTICLE: "concurrency.distributed.example" "Distributed Concurrency Example"
 "In this example the Factor instance associated with port 9000 will run "
 "a thread that receives and prints messages "
-"in the listener. The code to start the thread is: "
+"in the listener. The code to start the thread is:"
 { $examples
     { $unchecked-example
         ": log-message ( -- ) receive . flush log-message ;"
@@ -40,7 +40,7 @@ ARTICLE: "concurrency.distributed" "Distributed message passing"
 "The " { $vocab-link "concurrency.distributed" } " implements transparent distributed message passing, inspired by Erlang and Termite." $nl
 "Instances of " { $link thread } " can be sent to remote threads, at which point they are converted to objects holding the thread ID and the current node's host name:"
 { $subsections remote-thread }
-"The " { $vocab-link "serialize" } " vocabulary is used to convert Factor objects to byte arrays for transfer over a socket." 
+"The " { $vocab-link "serialize" } " vocabulary is used to convert Factor objects to byte arrays for transfer over a socket."
 { $subsections "concurrency.distributed.example" } ;
 
 ABOUT: "concurrency.distributed"
index 3df3a8da8f29c191c60697b9bff07f222627407d..7e08a789202ccb19418089960c99d4d15760e3a7 100644 (file)
@@ -5,7 +5,7 @@ IN: environment
 
 HELP: (os-envs)
 { $values
-    
+
      { "seq" sequence } }
 { $description "Returns a sequence of key/value pairs from the operating system." }
 { $notes "In most cases, use " { $link os-envs } " instead." } ;
@@ -22,7 +22,11 @@ HELP: os-env
 { $description "Looks up the value of a shell environment variable." }
 { $examples
     "This is an operating system-specific feature. On Unix, you can do:"
-    { $unchecked-example "\"USER\" os-env print" "jane" }
+    { $unchecked-example
+        "USING: environment io ;"
+        "\"USER\" os-env print"
+        "jane"
+    }
 } ;
 
 HELP: os-envs
index 08195ee07df89e49639629d8845003bdc35ee433..720991a609a70b87da9956a7e0a57608cab21e5f 100644 (file)
@@ -8,7 +8,7 @@ HELP: articles
 HELP: no-article
 { $values { "name" "an article name" } }
 { $description "Throws a " { $link no-article } " error." }
-{ $error-description "Thrown by " { $link help } " if the given help topic does not exist, or if the help topic being dispayed links to a help topic which does not exist." } ;
+{ $error-description "Thrown by " { $link help } " if the given help topic does not exist, or if the help topic being displayed links to a help topic which does not exist." } ;
 
 HELP: article
 { $values { "name" "an article name" } { "article" "an " { $link article } " object" } }
index a9695c667ad460f5f088b8afe69b342a56f80fd9..fb2e003c410731a34e473368b8fb339ecc3ab7cc 100644 (file)
@@ -17,7 +17,7 @@ $nl
     { { $slot "header" } { "An assoc of HTTP header values. See " { $link "http.headers" } } }
     { { $slot "post-data" } { "See " { $link "http.post-data" } } }
     { { $slot "cookies" } { "A sequence of HTTP cookies. See " { $link "http.cookies" } } }
-    { { $slot "redirects" } { "Number of redirects to attempt before throwing an error. Default is " { $snippet "max-redirects" } " ." } }
+    { { $slot "redirects" } { "Number of redirects to attempt before throwing an error. Default is " { $snippet "max-redirects" } "." } }
 } } ;
 
 HELP: <response>
@@ -105,7 +105,7 @@ $nl
 "Instances contain the following slots:"
 { $table
     { { $slot "data" } { "The POST data. This can be in a higher-level form, such as an assoc of POST parameters, a string, or an XML document" } }
-    { { $slot "params" } { "Parameters passed in the POST request." } } 
+    { { $slot "params" } { "Parameters passed in the POST request." } }
     { { $slot "content-type" } { "A MIME type" } }
     { { $slot "content-encoding" } { "Encoding used for the POST data" } }
 } } ;
index 2416db382f858a04211f8b0a35ec86f48601b08a..ffb19280c5a87d01de68e9221000964087f80e3e 100644 (file)
@@ -4,10 +4,10 @@ USING: help.markup help.syntax ;
 IN: io.encodings.8-bit.latin9
 
 HELP: latin9
-{ $var-description "This is the ISO-8859-15 encoding, also called Latin-9 and unoffically as Latin-0. It is an 8-bit superset of ASCII designed as a modification of Latin-1, removing little-used characters in favor of the Euro symbol and other characters." } 
+{ $var-description "This is the ISO-8859-15 encoding, also called Latin-9 and unofficially as Latin-0. It is an 8-bit superset of ASCII designed as a modification of Latin-1, removing little-used characters in favor of the Euro symbol and other characters." }
 { $see-also "encodings-introduction" } ;
 
 ARTICLE: "io.encodings.8-bit.latin9" "Latin9 encoding"
-"The " { $vocab-link "io.encodings.8-bit.latin9" }  " vocabulary provides the " { $link latin9 } " encoding." ;
+"The " { $vocab-link "io.encodings.8-bit.latin9" } " vocabulary provides the " { $link latin9 } " encoding." ;
 
 ABOUT: "io.encodings.8-bit.latin9"
index b8f560320062366c8eb071144fdd961c9a50e301..50a553c94875189fc8fc868d7f72c90320553777 100644 (file)
@@ -4,7 +4,7 @@ USING: help.markup help.syntax ;
 IN: io.encodings.shift-jis
 
 ARTICLE: "io.encodings.shift-jis" "Shift JIS"
-"Shift JIS is a text encoding for Japanese. There are multiple versions, depending on whether the offical standard or the modified Microsoft version is required."
+"Shift JIS is a text encoding for Japanese. There are multiple versions, depending on whether the official standard or the modified Microsoft version is required."
 { $subsections
     shift-jis
     windows-31j
index 80693c0963db7dda2da8ba744fc8d29251874913..095a03ab7b7a10cd63d5ec239c88e30b1452fb92 100644 (file)
@@ -41,7 +41,7 @@ M: icmp4 resolve-host 1array ;
 
 TUPLE: icmp6 < ipv6 ;
 
-C: <icmp6> icmp6
+: <icmp6> ( host -- icmp6 ) 0 icmp6 boa ;
 
 M: ipv6 with-icmp host>> <icmp6> ;
 
index f87ad93fbd59e0c1b13615f00fe26e606a2887a2..3572a9a8455615e6d1a53c521401350660f38de1 100644 (file)
@@ -41,7 +41,11 @@ io.sockets.secure.unix.debug ;
     ] server-test
 ] unit-test
 
-[ client-test ] [ premature-close? ] must-fail-with
+! Actually, this should not be an error since many HTTPS servers
+! (eg, google.com) do this.
+
+! [ client-test ] [ premature-close? ] must-fail-with
+[ "hello" ] [ client-test ] unit-test
 
 ! Now, try validating the certificate. This should fail because its
 ! actually an invalid certificate
index afd0ae1c4455a40be7aa5f48ed6b0c3b9153cf4a..ea95ae97266add86f17f0c5cada1c2b83e11c599 100644 (file)
@@ -110,7 +110,7 @@ HELP: local
 HELP: inet
 { $class-description "Host name/port number specifier for TCP/IP and UDP/IP connections. The " { $snippet "host" } " and " { $snippet "port" } " slots hold the host name and port name or number, respectively. New instances are created by calling " { $link <inet> } "." }
 { $notes
-    "This address specifier is only supported by " { $link <client> } ", which calls " { $link resolve-host }  " to obtain a list of IP addresses associated with the host name, and attempts a connection to each one in turn until one succeeds. Other network words do not accept this address specifier, and " { $link resolve-host } " must be called directly; it is then up to the application to pick the correct address from the (possibly several) addresses associated to the host name."
+    "This address specifier is only supported by " { $link <client> } ", which calls " { $link resolve-host } " to obtain a list of IP addresses associated with the host name, and attempts a connection to each one in turn until one succeeds. Other network words do not accept this address specifier, and " { $link resolve-host } " must be called directly; it is then up to the application to pick the correct address from the (possibly several) addresses associated to the host name."
 }
 { $examples
     { $code "\"www.apple.com\" 80 <inet>" }
@@ -143,7 +143,7 @@ HELP: <inet6>
 { $description "Creates a new " { $link inet6 } " address specifier. A value of " { $link f } " as the host refers to localhost, while " { $link f } " as the port defers the port choice until a later time." } ;
 
 HELP: <client>
-{ $values { "remote" "an address specifier" } { "encoding" "an encding descriptor" } { "stream" "a bidirectional stream" } { "local" "an address specifier" } }
+{ $values { "remote" "an address specifier" } { "encoding" "an encoding descriptor" } { "stream" "a bidirectional stream" } { "local" "an address specifier" } }
 { $description "Opens a network connection and outputs a bidirectional stream using the given encoding, together with the local address the socket was bound to." }
 { $errors "Throws an error if the connection cannot be established." }
 { $notes "The " { $link with-client } " word is easier to use in most situations." }
@@ -157,7 +157,7 @@ HELP: with-client
 { $errors "Throws an error if the connection cannot be established." } ;
 
 HELP: <server>
-{ $values  { "addrspec" "an address specifier" } { "encoding" "an encoding descriptor" } { "server" "a handle" } }
+{ $values { "addrspec" "an address specifier" } { "encoding" "an encoding descriptor" } { "server" "a handle" } }
 { $description
     "Begins listening for network connections to a local address. Server objects respond to two words:"
     { $list
@@ -225,7 +225,7 @@ HELP: with-local-address
 { $description "Client sockets opened within the scope of the quotation passed to this combinator will have their local address bound to the given address." }
 { $examples
   { "Binds the local address of a newly created client socket within the quotation to 127.0.0.1."
-    "This ensures that all traffic originates from the given address (the port is choosen by the TCP stack)." }
+    "This ensures that all traffic originates from the given address (the port is chosen by the TCP stack)." }
   { $code "\"127.0.0.1\" 0 <inet4> [ ] with-local-address" }
   $nl
   { "Binds the local address of a newly created client socket within the quotation to the local address 192.168.0.1 and the local port 23000. "
index d6015127532ebb91b7fd7c14daa8bffbd4982643..0c79323a246929c10dfa058c1cb464fb2b219ffe 100644 (file)
@@ -1,11 +1,12 @@
 USING: io.sockets io.sockets.private sequences math tools.test
 namespaces accessors kernel destructors calendar io.timeouts
 io.encodings.utf8 io concurrency.promises threads
-io.streams.string ;
+io.streams.string present ;
 IN: io.sockets.tests
 
+[ T{ local f "/tmp/foo" } ] [ "/tmp/foo" <local> ] unit-test
 [ T{ inet4 f f 0 } ] [ f 0 <inet4> ] unit-test
-[ T{ inet6 f f 0 } ] [ f 0 <inet6> ] unit-test
+[ T{ inet6 f f 0 1 } ] [ f 1 <inet6> ] unit-test
 
 [ T{ inet f "google.com" f } ] [ "google.com" f <inet> ] unit-test
 
@@ -13,10 +14,23 @@ IN: io.sockets.tests
 [ T{ inet f "google.com" 80 } ] [ "google.com" 0 <inet> 80 with-port ] unit-test
 [ T{ inet4 f "8.8.8.8" 0 } ] [ "8.8.8.8" 0 <inet4> ] unit-test
 [ T{ inet4 f "8.8.8.8" 53 } ] [ "8.8.8.8" 0 <inet4> 53 with-port ] unit-test
-[ T{ inet6 f "5:5:5:5:6:6:6:6" 12 } ] [ "5:5:5:5:6:6:6:6" 0 <inet6> 12 with-port ] unit-test
+[ T{ inet6 f "5:5:5:5:6:6:6:6" 0 12 } ] [ "5:5:5:5:6:6:6:6" 0 <inet6> 12 with-port ] unit-test
+[ T{ inet6 f "fe80::1" 1 80 } ] [ T{ ipv6 f "fe80::1" 1 } 80 with-port ] unit-test
+
+: test-sockaddr ( addrspec -- )
+    [ dup make-sockaddr ] keep parse-sockaddr assert= ;
+
+[ ] [ T{ inet4 f "8.8.8.8" 53 } test-sockaddr ] unit-test
+[ ] [ T{ inet6 f "5:5:5:5:6:6:6:6" 0 12 } test-sockaddr ] unit-test
+[ ] [ T{ inet6 f "fe80:0:0:0:0:0:0:1" 1 80 } test-sockaddr ] unit-test
 
 [ T{ inet f "google.com" 80 } ] [ "google.com" 80 with-port ] unit-test
 
+! Test present on addrspecs
+[ "4.4.4.4:12" ] [ "4.4.4.4" 12 <inet4> present ] unit-test
+[ "::1:12" ] [ "::1" 12 <inet6> present ] unit-test
+[ "fe80::1%1:12" ] [ "fe80::1" 1 12 inet6 boa present ] unit-test
+
 [ B{ 1 2 3 4 } ]
 [ "1.2.3.4" T{ inet4 } inet-pton ] unit-test
 
index fcdc00d1279e4bc2682c17b3a930bd0edb3b7f77..b567721e3f0e9f2bd1c8c88d260e7cacbef2b6ee 100644 (file)
@@ -125,9 +125,11 @@ M: inet4 present
 
 M: inet4 protocol drop 0 ;
 
-TUPLE: ipv6 { host ?string read-only } ;
+TUPLE: ipv6
+{ host ?string read-only }
+{ scope-id integer read-only } ;
 
-C: <ipv6> ipv6
+: <ipv6> ( host -- ipv6 ) 0 ipv6 boa ;
 
 M: ipv6 inet-ntop ( data addrspec -- str )
     drop 16 memory>byte-array 2 <groups> [ be> >hex ] map ":" join ;
@@ -184,23 +186,31 @@ M: ipv6 make-sockaddr ( inet -- sockaddr )
         AF_INET6 >>family
         swap
         [ port>> htons >>port ]
-        [ host>> "::" or ]
-        [ inet-pton >>addr ] tri ;
+        [ [ host>> "::" or ] keep inet-pton >>addr ]
+        [ scope-id>> >>scopeid ]
+        tri ;
 
 M: ipv6 parse-sockaddr
-    [ addr>> ] dip inet-ntop <ipv6> ;
+    [ [ addr>> ] dip inet-ntop ] [ drop scopeid>> ] 2bi
+    ipv6 boa ;
+
+M: ipv6 present
+    [ host>> ] [ scope-id>> ] bi
+    [ number>string "%" glue ] unless-zero ;
 
 TUPLE: inet6 < ipv6 { port integer read-only } ;
 
-C: <inet6> inet6
+: <inet6> ( host port -- inet6 ) [ 0 ] dip inet6 boa ;
 
-M: ipv6 with-port [ host>> ] dip <inet6> ;
+M: ipv6 with-port
+    [ [ host>> ] [ scope-id>> ] bi ] dip
+    inet6 boa ;
 
 M: inet6 parse-sockaddr
     [ call-next-method ] [ drop port>> ntohs ] 2bi with-port ;
 
 M: inet6 present
-    [ host>> ] [ port>> number>string ] bi ":" glue ;
+    [ call-next-method ] [ port>> number>string ] bi ":" glue ;
 
 M: inet6 protocol drop 0 ;
 
index 98338639bb6f03a166ba65dc1fb79b2f36d453ba..437bcfe9bb93dbdb24fbdd911222b742761b3b08 100644 (file)
@@ -221,7 +221,7 @@ HELP: background
         "10 iota ["
         "    \"Hello world\\n\""
         "    swap 10 / 1 over - over 1 <rgba>"
-        "    background associate format nl"
+        "    background associate format"
         "] each"
     }
 } ;
index a3056b03327f334fb65102d6cce345333361921b..bb47d31fcfb1d0145d1a922f595d406852692116 100644 (file)
@@ -62,11 +62,11 @@ ARTICLE: { "lists" "manipulation" } "Manipulating lists"
     lcut
 } ;
 
-HELP: cons 
+HELP: cons
 { $values { "car" "the head of the list cell" } { "cdr" "the tail of the list cell" } { "cons" list } }
 { $description "Constructs a cons cell." } ;
 
-HELP: swons 
+HELP: swons
 { $values { "cdr" "the tail of the list cell" } { "car" "the head of the list cell" } { "cons" list } }
 { $description "Constructs a cons cell." } ;
 
@@ -82,11 +82,11 @@ HELP: cdr
 
 { car cdr } related-words
 
-HELP: nil 
+HELP: nil
 { $values { "symbol" "The empty cons (+nil+)" } }
 { $description "Returns a symbol representing the empty list" } ;
 
-HELP: nil? 
+HELP: nil?
 { $values { "object" object } { "?" "a boolean" } }
 { $description "Return true if the cons object is the nil cons." } ;
 
@@ -108,12 +108,12 @@ HELP: 3list
 
 HELP: lnth
 { $values { "n" "an integer index" } { "list" list } { "elt" "the element at the nth index" } }
-{ $description "Outputs the nth element of the list." } 
+{ $description "Outputs the nth element of the list." }
 { $see-also llength cons car cdr } ;
 
 HELP: llength
 { $values { "list" list } { "n" "a non-negative integer" } }
-{ $description "Outputs the length of the list. This should not be called on an infinite list." } 
+{ $description "Outputs the length of the list. This should not be called on an infinite list." }
 { $see-also lnth cons car cdr } ;
 
 HELP: uncons
@@ -132,11 +132,11 @@ HELP: leach
 
 HELP: foldl
 { $values { "list" list } { "identity" "an object" } { "quot" { $quotation "( ... prev elt -- ... next )" } } { "result" "the final result" } }
-{ $description "Combines successive elements of the list (in a left-assocative order) using a binary operation and outputs the final result." } ;
+{ $description "Combines successive elements of the list (in a left-associative order) using a binary operation and outputs the final result." } ;
 
 HELP: foldr
 { $values { "list" list } { "identity" "an object" } { "quot" { $quotation "( ... prev elt -- ... next )" } } { "result" "the final result" } }
-{ $description "Combines successive elements of the list (in a right-assocative order) using a binary operation, and outputs the final result." } ;
+{ $description "Combines successive elements of the list (in a right-associative order) using a binary operation, and outputs the final result." } ;
 
 HELP: lmap
 { $values { "list" list } { "quot" { $quotation "( ... elt -- ... newelt )" } } { "result" "the final result" } }
@@ -144,9 +144,9 @@ HELP: lmap
 
 HELP: lreverse
 { $values { "list" list } { "newlist" list } }
-{ $description "Reverses the input list, outputing a new, reversed list. The output is a strict cons list." } ;
+{ $description "Reverses the input list, outputting a new, reversed list. The output is a strict cons list." } ;
 
-HELP: list>array    
+HELP: list>array
 { $values { "list" list } { "array" array } }
 { $description "Convert a list into an array." } ;
 
index 69a7ef25f67457b2e5df799e93ac76396fbdc2a5..b2275360c7d57a7dc3615c0c3d34624f4a7d8036 100644 (file)
@@ -55,7 +55,7 @@ $nl
 { $examples "See " { $link "locals-examples" } "." } ;
 
 { POSTPONE: MEMO: POSTPONE: MEMO:: } related-words
-                                          
+
 HELP: M::
 { $syntax "M:: class generic ( vars... -- outputs... ) body... ;" }
 { $description "Defines a new method on " { $snippet "generic" } " for " { $snippet "class" } " with named inputs. The method binds its input values to lexical variables from left to right, then executes the body with those bindings in scope."
@@ -127,7 +127,7 @@ TUPLE: counter adder subtractor ;
 <counter>
 [ adder>>      call . ]
 [ adder>>      call . ]
-[ subtractor>> call . ] tri """
+[ subtractor>> call . ] tri"""
 """1
 2
 1"""
@@ -149,7 +149,7 @@ mutable-example [ call . ] bi@"""
 6
 6
 6"""
-} 
+}
     "In " { $snippet "rebinding-example" } ", the binding of " { $snippet "a" } " to " { $snippet "5" } " is closed over in the first quotation, and the binding of " { $snippet "a" } " to " { $snippet "6" } " is closed over in the second, so calling both quotations results in " { $snippet "5" } " and " { $snippet "6" } " respectively. By contrast, in " { $snippet "mutable-example" } ", both quotations close over a single binding of " { $snippet "a" } ". Even though " { $snippet "a" } " is assigned to " { $snippet "6" } " after the first quotation is made, calling either quotation will output the new value of " { $snippet "a" } "."
 { $heading "Lexical variables in literals" }
 "Some kinds of literals can include references to lexical variables as described in " { $link "locals-literals" } ". For example, the " { $link 3array } " word could be implemented as follows:"
@@ -161,7 +161,7 @@ IN: scratchpad
 1 "two" 3.0 my-3array ."""
 """{ 1 "two" 3.0 }"""
 } ;
-                                                 
+
 ARTICLE: "locals-literals" "Lexical variables in literals"
 "Certain data type literals are permitted to contain lexical variables. Any such literals are rewritten into code which constructs an instance of the type with the values of the variables spliced in. Conceptually, this is similar to the transformation applied to quotations containing free variables."
 $nl
index 133509687fb5e9133eac9589da5c95c5d7fad1a0..91aa2fa3e514aef6cdae45ba1e9d3ea6ce3d27da 100644 (file)
@@ -16,9 +16,9 @@ HELP: MACRO:
 { $examples
   "A macro that calls a quotation but preserves any values it consumes off the stack:"
   { $code
-    "USING: fry generalizations ;" 
+    "USING: fry generalizations kernel macros stack-checker ;"
     "MACRO: preserving ( quot -- )"
-    "    [ infer in>> length ] keep '[ _ ndup @ ] ;"
+    "    [ inputs ] keep '[ _ ndup @ ] ;"
   }
   "Using this macro, we can define a variant of " { $link if } " which takes a predicate quotation instead of a boolean; any values consumed by the predicate quotation are restored immediately after:"
   { $code
index 75a54c2300d4c6e9f89c70bb80c09361de03b551..9b2a29bd7339d734665e471b601338ad150329b8 100644 (file)
@@ -4,7 +4,7 @@ IN: math.combinatorics
 HELP: factorial
 { $values { "n" "a non-negative integer" } { "n!" integer } }
 { $description "Outputs the product of all positive integers less than or equal to " { $snippet "n" } "." }
-{ $examples 
+{ $examples
     { $example "USING: math.combinatorics prettyprint ;"
         "4 factorial ." "24" }
 } ;
@@ -46,7 +46,7 @@ HELP: all-permutations
 
 HELP: each-permutation
 { $values { "seq" sequence } { "quot" { $quotation "( seq -- )" } } }
-{ $description "Applies the quotation to each permuation of " { $snippet "seq" } " in order." } ;
+{ $description "Applies the quotation to each permutation of " { $snippet "seq" } " in order." } ;
 
 HELP: inverse-permutation
 { $values { "seq" sequence } { "permutation" sequence } }
@@ -121,7 +121,7 @@ HELP: selections
 { $description
     "Returns all the ways to take n (possibly the same) items from the "
     "sequence of items."
-} 
+}
 { $examples
     { $example
         "USING: math.combinatorics prettyprint ;"
index 59246a6e64503c169b07b50fd46009fbb23b39ef..3c8e6ae3364b09ae33a425e4ae35afe386dde46a 100644 (file)
@@ -150,7 +150,7 @@ int-4{ f f t f } ."""
 $nl
 "Providing a SIMD boolean vector with element values other than the proper true and false representations as an input to the vector logical or test operations is undefined. Do not count on operations such as " { $link vall? } " or " { $link v? } " using bitwise operations to construct their results."
 $nl
-"This applies to the output of the following element comparison words: "
+"This applies to the output of the following element comparison words:"
 { $list
 { $link v< }
 { $link v<= }
index 7b740a4dc3cb112d1357849bf561fb3e649a7486..b03ec455269306fe07b4e984d0d6e9d25ed6683e 100644 (file)
@@ -319,7 +319,7 @@ ARTICLE: "peg.ebnf.tokenizers" "Tokenizers"
 "This parser when run with the string \"++--\" or the array "
 "{ CHAR: + CHAR: + CHAR: - CHAR: - } will succeed with an AST of { \"++\" \"--\" }. "
 "If you want to add whitespace handling to the grammar you need to put it "
-"between the terminals: "
+"between the terminals:"
 { $examples
     { $code
         "EBNF: foo"
@@ -332,7 +332,7 @@ ARTICLE: "peg.ebnf.tokenizers" "Tokenizers"
 "In a large grammar this gets tedious and makes the grammar hard to read. "
 "Instead you can write a rule to split the input sequence into tokens, and "
 "have the grammar operate on these tokens. This is how the previous example "
-"might look: "
+"might look:"
 { $examples
     { $code
         "EBNF: foo"
@@ -355,7 +355,7 @@ ARTICLE: "peg.ebnf.tokenizers" "Tokenizers"
 $nl
 "In this example I split the tokenizer into a separate parser and use "
 "'foreign' to call it from the main one. This allows testing of the "
-"tokenizer separately: "
+"tokenizer separately:"
 { $examples
     { $example
         "USING: prettyprint peg peg.ebnf kernel math.parser strings"
@@ -397,7 +397,7 @@ $nl
 "working in one pass. There is no tokenization occurring over the whole string "
 "followed by the parse of that result. It tokenizes as it needs to. You can even "
 "switch tokenizers multiple times during a grammar. Rules use the tokenizer that "
-"was defined lexically before the rule. This is usefull in the JavaScript grammar: "
+"was defined lexically before the rule. This is usefull in the JavaScript grammar:"
 { $examples
     { $code
         "EBNF: javascript"
@@ -440,7 +440,7 @@ ARTICLE: "peg.ebnf" "EBNF"
     POSTPONE: [EBNF
     POSTPONE: EBNF:
 }
-"The EBNF syntax is composed of a series of rules of the form: "
+"The EBNF syntax is composed of a series of rules of the form:"
 { $code
   "rule1 = ..."
   "rule2 = ..."
@@ -448,7 +448,7 @@ ARTICLE: "peg.ebnf" "EBNF"
 "The last defined rule is the main rule for the EBNF. It is the first one run "
 "and it is expected that the remaining rules are used by that rule. Rules may be "
 "left recursive. "
-"Each rule can contain the following: "
+"Each rule can contain the following:"
 { $subsections "peg.ebnf.strings"
 "peg.ebnf.any"
 "peg.ebnf.sequence"
index 6b3bdd354fb7b1caaeb831837570363fec5af127..620b3759a261d855d62a6fc8c81429631570915d 100644 (file)
@@ -48,7 +48,7 @@ ARTICLE: "inference-combinators" "Combinator stack effects"
   ": perform ( value action -- result ) quot>> call( value -- result ) ;"
 }
 { $subheading "Passing an unknown quotation to an inline combinator" }
-"Suppose we want to write :"
+"Suppose we want to write:"
 { $code ": perform ( values action -- results ) quot>> map ;" }
 "However this fails to pass the stack checker since there is no guarantee the quotation has the right stack effect for " { $link map } ". It can be wrapped in a new quotation with a declaration:"
 { $code ": perform ( values action -- results )" "    quot>> [ call( value -- result ) ] curry map ;" }
index 0d0dba325f79f1e02e4a2c126df0a3f45dce0e6a..aa2bca26f17ba290232b1bba3a0f4aae8086ef9b 100644 (file)
@@ -137,9 +137,16 @@ os macosx? [
 
 [ ] [ "tools.deploy.test.20" shake-and-bake ] unit-test
 
-[ "<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo>Factor</foo>\n" ]
-[ deploy-test-command ascii [ contents ] with-process-reader ] unit-test
+[ "<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo>Factor</foo>" ]
+[ deploy-test-command ascii [ readln ] with-process-reader ] unit-test
 
 [ ] [ 800000 small-enough? ] unit-test
 
+[ ] [ "tools.deploy.test.21" shake-and-bake ] unit-test
+
+[ "1 2 3" ]
+[ deploy-test-command ascii [ readln ] with-process-reader ] unit-test
+
+[ ] [ 600000 small-enough? ] unit-test
+
 [ ] [ "benchmark.ui-panes" shake-and-bake run-temp-image ] unit-test
diff --git a/basis/tools/deploy/test/21/21.factor b/basis/tools/deploy/test/21/21.factor
new file mode 100644 (file)
index 0000000..1f5cbc9
--- /dev/null
@@ -0,0 +1,7 @@
+USING: formatting ;
+IN: tools.deploy.test.21
+
+: formatting-test ( -- )
+    1 2 3 "%d %d %d" printf ;
+
+MAIN: formatting-test
diff --git a/basis/tools/deploy/test/21/deploy.factor b/basis/tools/deploy/test/21/deploy.factor
new file mode 100644 (file)
index 0000000..7c155de
--- /dev/null
@@ -0,0 +1,15 @@
+USING: tools.deploy.config ;
+H{
+    { deploy-name "tools.deploy.test.21" }
+    { deploy-ui? f }
+    { deploy-c-types? f }
+    { deploy-console? t }
+    { deploy-unicode? f }
+    { "stop-after-last-window?" t }
+    { deploy-io 2 }
+    { deploy-reflection 1 }
+    { deploy-word-props? f }
+    { deploy-math? t }
+    { deploy-threads? t }
+    { deploy-word-defs? f }
+}
diff --git a/basis/tools/dns/authors.txt b/basis/tools/dns/authors.txt
deleted file mode 100644 (file)
index 7c1b2f2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Doug Coleman
diff --git a/basis/tools/dns/dns.factor b/basis/tools/dns/dns.factor
deleted file mode 100644 (file)
index f59a9da..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-! Copyright (C) 2010 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: dns io kernel math.parser sequences ;
-IN: tools.dns
-
-: a-line. ( host ip -- )
-    [ write " has address " write ] [ print ] bi* ;
-
-: a-message. ( message -- )
-    [ message>query-name ] [ message>names ] bi
-    [ a-line. ] with each ;
-
-: mx-line. ( host pair -- )
-    [ write " mail is handled by " write ]
-    [ first2 [ number>string write bl ] [ print ] bi* ] bi* ;
-
-: mx-message. ( message -- )
-    [ message>query-name ] [ message>mxs ] bi
-    [ mx-line. ] with each ;
-
-: host ( domain -- )
-    [ dns-A-query a-message. ]
-    [ dns-AAAA-query a-message. ]
-    [ dns-MX-query mx-message. ] tri ;
index 966ac37d30ca1f67e0d43b436dfbf72a7c1a5270..fd09e6026690329ab045e5f28f3209393296628a 100644 (file)
@@ -32,7 +32,7 @@ $nl
 { $heading "Implementation" }
 "Listeners are instances of " { $link listener-gadget } ". The listener consists of an output area (instance of " { $link pane } ") and an input area (instance of " { $link interactor } "). Clickable presentations can also be printed to the listener; see " { $link "ui-presentations" } "." ;
 
-TIP: "You can read documentation by pressing F1." ;
+TIP: "You can read documentation by pressing " { $snippet "F1" } "." ;
 
 TIP: "The listener tool remembers previous lines of input. Press " { $command interactor "completion" recall-previous } " and " { $command interactor "completion" recall-next } " to cycle through them." ;
 
index 8098f91eeef95f73faae0c338c7db9ba19734240..f4c27776e2e099fec0d546ed838c83aae736838e 100644 (file)
@@ -323,7 +323,7 @@ HELP: assoc-stack
 
 HELP: value-at*
 { $values { "value" object } { "assoc" assoc } { "key/f" "the key associated to the value, or " { $link f } } { "?" boolean } }
-{ $description "Looks up the key associated with a value. The boolean flag can decide beteen the case of a missing key, and a key of " { $link f } "." } ;
+{ $description "Looks up the key associated with a value. The boolean flag can decide between the case of a missing key, and a key of " { $link f } "." } ;
 
 HELP: value-at
 { $values { "value" object } { "assoc" assoc } { "key/f" "the key associated to the value, or " { $link f } } }
@@ -438,7 +438,7 @@ HELP: assoc-map-as
 { $values
      { "assoc" assoc } { "quot" { $quotation "( ... key value -- ... newkey newvalue )" } } { "exemplar" assoc }
      { "newassoc" assoc } }
-{ $description "Applies the quotation to each entry in the input assoc and collects the results in a new assoc of the stame type as the exemplar." }
+{ $description "Applies the quotation to each entry in the input assoc and collects the results in a new assoc of the same type as the exemplar." }
 { $examples { $example "USING: prettyprint assocs hashtables math ;" " H{ { 1 2 } { 3 4 } } [ sq ] { } assoc-map-as ." "{ { 1 4 } { 3 16 } }" } } ;
 
 HELP: extract-keys
@@ -457,7 +457,7 @@ HELP: push-at
 { $values
      { "value" object } { "key" object } { "assoc" assoc } }
 { $description "Pushes the " { $snippet "value" } " onto a " { $snippet "vector" } " stored at the " { $snippet "key" } " in the " { $snippet "assoc" } ". If the " { $snippet "key" } " does not yet exist, creates a new " { $snippet "vector" } " at that " { $snippet "key" } " and pushes the " { $snippet "value" } "." }
-{ $examples { $example  "USING: prettyprint assocs kernel ;"
+{ $examples { $example "USING: prettyprint assocs kernel ;"
 "H{ { \"cats\" V{ \"Mittens\" } } } \"Mew\" \"cats\" pick push-at ."
 "H{ { \"cats\" V{ \"Mittens\" \"Mew\" } } }"
 } } ;
@@ -467,7 +467,7 @@ HELP: search-alist
      { "key" object } { "alist" "an array of key/value pairs" }
      { "pair/f" "a key/value pair" } { "i/f" integer } }
 { $description "Iterates over " { $snippet "alist" } " and stops when the key is matched or the end of the " { $snippet "alist" } " has been reached. If there is no match, both outputs are " { $link f } "." }
-{ $notes "This word is used to implement " { $link at* } " and " { $link set-at } " on sequences, and should not be called direclty." }
+{ $notes "This word is used to implement " { $link at* } " and " { $link set-at } " on sequences, and should not be called directly." }
 { $examples { $example "USING: prettyprint assocs.private kernel ;"
                         "3 { { 1 2 } { 3 4 } } search-alist [ . ] bi@"
                        "{ 3 4 }\n1"
index afcb42b111bb9bd8fedae72d447a2de649208b1e..1c5bec67161b23c4146b6b2ff20d4e61e0f78e99 100644 (file)
@@ -5,7 +5,7 @@ classes.predicate quotations ;
 IN: classes
 
 ARTICLE: "class-predicates" "Class predicate words"
-"With a handful of exceptions, each class has a membership predicate word, named " { $snippet { $emphasis "class" } "?" } " . A quotation calling this predicate is stored in the " { $snippet "\"predicate\"" } " word property."
+"With a handful of exceptions, each class has a membership predicate word, named " { $snippet { $emphasis "class" } "?" } ". A quotation calling this predicate is stored in the " { $snippet "\"predicate\"" } " word property."
 $nl
 "When it comes to predicates, the exceptional classes are:"
 { $table
@@ -94,7 +94,7 @@ $low-level-note ;
 HELP: superclass
 { $values { "class" class } { "super" class } }
 { $description "Outputs the superclass of a class. All instances of this class are also instances of the superclass." }
-{ $examples 
+{ $examples
     { $example "USING: classes prettyprint ;"
                "t superclass ."
                "word"
@@ -106,7 +106,7 @@ HELP: superclasses
      { "class" class }
      { "supers" sequence } }
 { $description "Outputs a sequence of superclasses of a class along with the class itself." }
-{ $examples 
+{ $examples
     { $example "USING: classes prettyprint ;"
                "t superclasses ."
                "{ word t }"
@@ -120,7 +120,7 @@ HELP: subclass-of?
     { "?" boolean }
 }
 { $description "Outputs a boolean value indicating whether " { $snippet "class" } " is at any level a subclass of " { $snippet "superclass" } "." }
-{ $examples 
+{ $examples
     { $example "USING: classes classes.tuple prettyprint words ;"
                "tuple-class \\ class subclass-of? ."
                "t"
index 9c22221e70130a1f1a8dcc3a983073adbc591980..a1488ca5c678f8baa35dc75aadb329a443e2b7af 100644 (file)
@@ -326,12 +326,14 @@ HELP: cond
 }
 { $errors "Throws a " { $link no-cond } " error if none of the test quotations yield a true value." }
 { $examples
-    { $code
-        "{"
-        "    { [ dup 0 > ] [ \"positive\" ] }"
-        "    { [ dup 0 < ] [ \"negative\" ] }"
-        "    [ \"zero\" ]"
-        "} cond"
+    { $example
+        "USING: combinators io kernel math ;"
+        "0 {"
+        "    { [ dup 0 > ] [ drop \"positive\" ] }"
+        "    { [ dup 0 < ] [ drop \"negative\" ] }"
+        "    [ drop \"zero\" ]"
+        "} cond print"
+        "zero"
     }
 } ;
 
@@ -340,7 +342,7 @@ HELP: no-cond
 { $error-description "Thrown by " { $link cond } " if none of the test quotations yield a true value. Some uses of " { $link cond } " include a default case where the test quotation is " { $snippet "[ t ]" } "; such a " { $link cond } " form will never throw this error." } ;
 
 HELP: case
-{ $values { "obj" object } { "assoc" "a sequence of object/word,quotation pairs, with an optional quotation at the end" } }
+{ $values { "obj" object } { "assoc" "a sequence of object/word, quotation pairs, with an optional quotation at the end" } }
 { $description
     "Compares " { $snippet "obj" } " against the first element of every pair, first evaluating the first element if it is a word. If some pair matches, removes " { $snippet "obj" } " from the stack and calls the second element of that pair, which must be a quotation."
     $nl
@@ -353,6 +355,7 @@ HELP: case
 { $examples
     { $example
         "USING: combinators io kernel ;"
+        "IN: scratchpad"
         "SYMBOLS: yes no maybe ;"
         "maybe {"
         "    { yes [ ] } ! Do nothing"
index 300c9c63bc84da51c0f0f7ce2891b05b7c187857..b553c0c3848dacc3c284ca6da187e68ae29446a9 100644 (file)
@@ -265,7 +265,7 @@ HELP: return
 HELP: with-return
 { $values
      { "quot" quotation } }
-{ $description "Captures a continuation that can be reified by calling the " { $link return } " word. If so, it will resume execution immediatly after the " { $link with-return } " word. If " { $link return } " is not called, then execution proceeds as if this word were simply " { $link call } "." }
+{ $description "Captures a continuation that can be reified by calling the " { $link return } " word. If so, it will resume execution immediately after the " { $link with-return } " word. If " { $link return } " is not called, then execution proceeds as if this word were simply " { $link call } "." }
 { $examples
     "Only \"Hi\" will print:"
     { $example
index 049104e61c164e4e3bc3cff54faaa30a4942b89c..d92c250faf34e9b9c2693b4ec6488a643a2e63b4 100644 (file)
@@ -34,7 +34,7 @@ $nl
 $nl
 "Now, after some heavily editing and refactoring, the file looks like this:"
 { $code
-    "USING: namespaces ;"
+    "USING: make ;"
     "IN: a"
     ": hello ( -- ) \"Hello\" % ;"
     ": hello-world ( -- str ) [ hello \" \" % world ] \"\" make ;"
index 18434166b9933004b231dd34f948dc2923ee877b..2afefe1f2bf10cc65431df546de1acf879b8a22d 100644 (file)
@@ -716,7 +716,7 @@ HELP: MATH:
 { $description "Defines a new generic word which uses the " { $link math-combination } " method combination." } ;
 
 HELP: HOOK:
-{ $syntax "HOOK: word variable ( stack -- effect ) " }
+{ $syntax "HOOK: word variable ( stack -- effect )" }
 { $values { "word" "a new word to define" } { "variable" word } }
 { $description "Defines a new hook word in the current vocabulary. Hook words are generic words which dispatch on the value of a variable, so methods are defined with " { $link POSTPONE: M: } ". Hook words differ from other generic words in that the dispatch value is removed from the stack before the chosen method is called." }
 { $examples
@@ -850,7 +850,7 @@ HELP: C:
     "The following two lines are equivalent:"
     { $code
         "C: <color> color"
-        ": <color> color boa ;"
+        ": <color> ( red green blue -- color ) color boa ;"
     }
     "In both cases, a word " { $snippet "<color>" } " is defined, which reads three values from the stack and creates a " { $snippet "color" } " instance having these values in the " { $snippet "red" } ", " { $snippet "green" } " and " { $snippet "blue" } " slots, respectively."
 } ;
index 69933a913cb0f6e01e175c1d8a9a860553187aa6..442bf29ead393b14699df6b4e71fd7ac3b897f88 100644 (file)
@@ -98,17 +98,17 @@ $nl
     { { { $snippet "\"inline\"" } ", " { $snippet "\"foldable\"" } ", " { $snippet "flushable" } } { $link "declarations" } }
 
     { { $snippet "\"loc\"" } { "Location information - " { $link where } } }
-    
+
     { { { $snippet "\"methods\"" } ", " { $snippet "\"combination\"" } } { "Set on generic words - " { $link "generic" } } }
-    
+
     { { { $snippet "\"reading\"" } ", " { $snippet "\"writing\"" } } { "Set on slot accessor words - " { $link "slots" } } }
 
     { { $snippet "\"declared-effect\"" } { $link "effects" } }
-    
+
     { { { $snippet "\"help\"" } ", " { $snippet "\"help-loc\"" } ", " { $snippet "\"help-parent\"" } } { "Where word help is stored - " { $link "writing-help" } } }
 
     { { $snippet "\"specializer\"" } { $link "hints" } }
-    
+
     { { $snippet "\"predicating\"" } " Set on class predicates, stores the corresponding class word" }
 }
 "Properties which are defined for classes only:"
@@ -117,13 +117,13 @@ $nl
     { { $snippet "\"class\"" } { "A boolean indicating whether this word is a class - " { $link "classes" } } }
 
     { { $snippet "\"coercer\"" } { "A quotation for converting the top of the stack to an instance of this class" } }
-    
+
     { { $snippet "\"constructor\"" } { $link "tuple-constructors" } }
-    
+
     { { $snippet "\"type\"" } { $link "builtin-classes" } }
-    
+
     { { { $snippet "\"superclass\"" } ", " { $snippet "\"predicate-definition\"" } } { $link "predicates" } }
-    
+
     { { $snippet "\"members\"" } { $link "unions" } }
 
     { { $snippet "\"slots\"" } { $link "slots" } }
@@ -165,7 +165,7 @@ ARTICLE: "words" "Words"
 $nl
 "There are two ways of creating word definitions:"
 { $list
-    "using parsing words at parse time,"
+    "using parsing words at parse time."
     "using defining words at run time."
 }
 "The latter is a more dynamic feature that can be used to implement code generation and such, and in fact parse time defining words are implemented in terms of run time defining words."
index 0f22b531c69ba12e837a76d8e9f94bc2d88d471c..4d3c80cbaa2abf635e40be648770871b098e3870 100644 (file)
@@ -42,7 +42,7 @@ IN: bunny.model
 
 : model-path ( -- path ) "bun_zipper.ply" temp-file ;
 
-: model-url ( -- url ) "http://factorcode.org/slava/bun_zipper.ply" ;
+: model-url ( -- url ) "http://duriansoftware.com/joe/media/bun_zipper.ply" ;
 
 : maybe-download ( -- path )
     model-path dup exists? [
index a0e6ba5f6e8656561370a4ed5fd5038f2d81bb6d..802d4d72775cb93272911745faa1a95e00b9b5eb 100644 (file)
@@ -368,7 +368,6 @@ M: SOA rdata>byte-array
 : message>query-name ( message -- string )
     query>> first name>> dotted> ;
 
-USE: nested-comments
 (*
 M: string resolve-host
     dup >lower "localhost" = [
index 0491191c63421ddc2caec50bda217df462c65d62..cb769add14a0cc26dc77445732504c4a9deb4090 100644 (file)
@@ -145,7 +145,7 @@ UNIFORM-TUPLE: loading-uniforms
 
 : bunny-model-path ( -- path ) "bun_zipper.ply" temp-file ;
 
-CONSTANT: bunny-model-url "http://factorcode.org/slava/bun_zipper.ply"
+CONSTANT: bunny-model-url "http://duriansoftware.com/joe/media/bun_zipper.ply"
 
 : download-bunny ( -- path )
     bunny-model-path dup exists? [
index 1d24bef2e3ec903610bd88cebaf02cea5a87814a..4e1b00527697b5c9a9882f797387c160a449a85b 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2010 Jon Harper.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: help.markup help.syntax kernel strings io.pathnames images 
+USING: help.markup help.syntax kernel strings io.pathnames images
 models opengl.textures classes ui.gadgets ;
 IN: images.viewer
 
@@ -69,10 +69,10 @@ HELP: stop-control
 }
 { $description "Removes the connection between the gadget and it's model" } ;
 ARTICLE: "images.viewer" "Displaying Images"
-"The " { $vocab-link "images.viewer" } " vocabulary uses the " { $vocab-link "opengl.textures" } 
-" vocabulary to display any instance of " { $link image } "."$nl 
-"An " { $link image-gadget } " can be used for static images and " { $instance image-control } 
-" for changing images (for example a video feed). For changing images, the image should be containted in " { $instance model } 
+"The " { $vocab-link "images.viewer" } " vocabulary uses the " { $vocab-link "opengl.textures" }
+" vocabulary to display any instance of " { $link image } "."$nl
+"An " { $link image-gadget } " can be used for static images and " { $instance image-control }
+" for changing images (for example a video feed). For changing images, the image should be containted in " { $instance model }
 ". Change the model value with " { $link set-model } " or mutate the image and call "
 { $link notify-connections } " when you want to update the image. To stop refreshing the image, call " { $link stop-control } "."
 " To start refreshing again, call " { $link start-control } "."
@@ -83,19 +83,19 @@ $nl
 { $subsections <image-gadget> <image-control> }
 "The " { $link image } " or " { $link model }
 " can also be given after the construction of the object. In this case, use "
-{ $link new-image-gadget } " and " { $link set-image } "." 
+{ $link new-image-gadget } " and " { $link set-image } "."
 " The gadget will automatically detect if the image changes size or format and reallocate a new texture if needed."
 " This means images can be set even after the gadget has been grafted. Grafted gadgets without an image will display a blank screen."
 
 { $notes "The image can be set after the gadget has been grafted. However, for " { $instance image-gadget } ", this can "
-" be done only once. If your image is changing, you should be using " { $instance image-control } " and " { $instance model } "." 
+" be done only once. If your image is changing, you should be using " { $instance image-control } " and " { $instance model } "."
 $nl
 " Performance will be greatly reduced if you are using images that have more than 512 pixels on one of their"
 " axis." }
 
 
 $nl
-"Utility words for displaying images :"
+"Utility words for displaying images:"
 { $subsections
 image. image-window }
 
diff --git a/extra/tools/dns/authors.txt b/extra/tools/dns/authors.txt
new file mode 100644 (file)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/extra/tools/dns/dns.factor b/extra/tools/dns/dns.factor
new file mode 100644 (file)
index 0000000..c3b6ad8
--- /dev/null
@@ -0,0 +1,24 @@
+! Copyright (C) 2010 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: dns io kernel math.parser sequences ;
+IN: tools.dns
+
+: a-line. ( host ip -- )
+    [ write " has address " write ] [ print ] bi* ;
+
+: a-message. ( message -- )
+    [ message>query-name ] [ message>a-names ] bi
+    [ a-line. ] with each ;
+
+: mx-line. ( host pair -- )
+    [ write " mail is handled by " write ]
+    [ first2 [ number>string write bl ] [ print ] bi* ] bi* ;
+
+: mx-message. ( message -- )
+    [ message>query-name ] [ message>mxs ] bi
+    [ mx-line. ] with each ;
+
+: host ( domain -- )
+    [ dns-A-query a-message. ]
+    [ dns-AAAA-query a-message. ]
+    [ dns-MX-query mx-message. ] tri ;