From b1566ef0a622a31877ccc2a3fd29792e8a5f16b4 Mon Sep 17 00:00:00 2001 From: Keita Haga Date: Sun, 20 Feb 2011 03:08:01 +0900 Subject: [PATCH 01/10] math.combinatorics: fix typo in docs --- basis/math/combinatorics/combinatorics-docs.factor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/basis/math/combinatorics/combinatorics-docs.factor b/basis/math/combinatorics/combinatorics-docs.factor index 75a54c2300..9b2a29bd73 100644 --- a/basis/math/combinatorics/combinatorics-docs.factor +++ b/basis/math/combinatorics/combinatorics-docs.factor @@ -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 ;" From 976d3d3ac02e808a373b60d3e71d7121caee79df Mon Sep 17 00:00:00 2001 From: Keita Haga Date: Sun, 20 Feb 2011 03:38:54 +0900 Subject: [PATCH 02/10] combinators.random: fix a couple of usage examples in casep and casep* --- basis/combinators/random/random-docs.factor | 40 ++++++++++++--------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/basis/combinators/random/random-docs.factor b/basis/combinators/random/random-docs.factor index 2fc0b8c00e..826474420c 100644 --- a/basis/combinators/random/random-docs.factor +++ b/basis/combinators/random/random-docs.factor @@ -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* ." } } From 382888822b352b783fe13a9d97c7944d3a600818 Mon Sep 17 00:00:00 2001 From: Keita Haga Date: Sun, 20 Feb 2011 04:08:45 +0900 Subject: [PATCH 03/10] environment: add using list to usage example of os-env word --- basis/environment/environment-docs.factor | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/basis/environment/environment-docs.factor b/basis/environment/environment-docs.factor index 3df3a8da8f..7e08a78920 100644 --- a/basis/environment/environment-docs.factor +++ b/basis/environment/environment-docs.factor @@ -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 From f767d60641b27560cb57eaecdfc750832c73f480 Mon Sep 17 00:00:00 2001 From: Keita Haga Date: Sun, 20 Feb 2011 04:53:35 +0900 Subject: [PATCH 04/10] definitions: import of make vocab in refactored a.factor --- core/definitions/definitions-docs.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/definitions/definitions-docs.factor b/core/definitions/definitions-docs.factor index 049104e61c..390ecd1b73 100644 --- a/core/definitions/definitions-docs.factor +++ b/core/definitions/definitions-docs.factor @@ -34,7 +34,7 @@ $nl $nl "Now, after some heavily editing and refactoring, the file looks like this:" { $code - "USING: namespaces ;" + "USING: make namespaces ;" "IN: a" ": hello ( -- ) \"Hello\" % ;" ": hello-world ( -- str ) [ hello \" \" % world ] \"\" make ;" From 975f77b48803b3601ab941eee241f1dc85069c59 Mon Sep 17 00:00:00 2001 From: Keita Haga Date: Sun, 20 Feb 2011 06:11:31 +0900 Subject: [PATCH 05/10] io.styles: remove a nl in usage example of background --- basis/io/styles/styles-docs.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/io/styles/styles-docs.factor b/basis/io/styles/styles-docs.factor index 98338639bb..437bcfe9bb 100644 --- a/basis/io/styles/styles-docs.factor +++ b/basis/io/styles/styles-docs.factor @@ -221,7 +221,7 @@ HELP: background "10 iota [" " \"Hello world\\n\"" " swap 10 / 1 over - over 1 " - " background associate format nl" + " background associate format" "] each" } } ; From 3b21317e9a9b237ca99a9d740635a49c2c0f6748 Mon Sep 17 00:00:00 2001 From: Keita Haga Date: Sun, 20 Feb 2011 09:16:41 +0900 Subject: [PATCH 06/10] locals: remove trailing whitespace in docs --- basis/locals/locals-docs.factor | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/basis/locals/locals-docs.factor b/basis/locals/locals-docs.factor index 69a7ef25f6..b2275360c7 100644 --- a/basis/locals/locals-docs.factor +++ b/basis/locals/locals-docs.factor @@ -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 ; [ 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 From 63d961608f49e2cdcd3c3a70ccb5cbaca4d851f1 Mon Sep 17 00:00:00 2001 From: Keita Haga Date: Sun, 20 Feb 2011 15:58:57 +0900 Subject: [PATCH 07/10] ui.tools.listener: highlighting F1 key in tips --- basis/ui/tools/listener/listener-docs.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/ui/tools/listener/listener-docs.factor b/basis/ui/tools/listener/listener-docs.factor index 966ac37d30..fd09e60266 100644 --- a/basis/ui/tools/listener/listener-docs.factor +++ b/basis/ui/tools/listener/listener-docs.factor @@ -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." ; From 70918ecf6c56976c7a26ab7a4f34ea7386001182 Mon Sep 17 00:00:00 2001 From: Keita Haga Date: Mon, 21 Feb 2011 02:46:06 +0900 Subject: [PATCH 08/10] io.encodings.8-bit.latin9, io.encodings.shift-jis: fix typo in docs. offical => official --- basis/io/encodings/8-bit/latin9/latin9-docs.factor | 4 ++-- basis/io/encodings/shift-jis/shift-jis-docs.factor | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/basis/io/encodings/8-bit/latin9/latin9-docs.factor b/basis/io/encodings/8-bit/latin9/latin9-docs.factor index 2416db382f..ffb19280c5 100644 --- a/basis/io/encodings/8-bit/latin9/latin9-docs.factor +++ b/basis/io/encodings/8-bit/latin9/latin9-docs.factor @@ -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" diff --git a/basis/io/encodings/shift-jis/shift-jis-docs.factor b/basis/io/encodings/shift-jis/shift-jis-docs.factor index b8f5603200..50a553c948 100644 --- a/basis/io/encodings/shift-jis/shift-jis-docs.factor +++ b/basis/io/encodings/shift-jis/shift-jis-docs.factor @@ -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 From 69d3b2a9bad69f733215856e3ba7e3ea8039d7c9 Mon Sep 17 00:00:00 2001 From: Keita Haga Date: Thu, 24 Feb 2011 15:37:41 +0900 Subject: [PATCH 09/10] definitions: remove unused vocabulary in refactored a.factor --- core/definitions/definitions-docs.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/definitions/definitions-docs.factor b/core/definitions/definitions-docs.factor index 390ecd1b73..d92c250faf 100644 --- a/core/definitions/definitions-docs.factor +++ b/core/definitions/definitions-docs.factor @@ -34,7 +34,7 @@ $nl $nl "Now, after some heavily editing and refactoring, the file looks like this:" { $code - "USING: make namespaces ;" + "USING: make ;" "IN: a" ": hello ( -- ) \"Hello\" % ;" ": hello-world ( -- str ) [ hello \" \" % world ] \"\" make ;" From 4c43079118a031da500da864e67a762937941fb6 Mon Sep 17 00:00:00 2001 From: Keita Haga Date: Fri, 25 Feb 2011 19:59:44 +0900 Subject: [PATCH 10/10] lists: fix a few typos in docs --- basis/lists/lists-docs.factor | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/basis/lists/lists-docs.factor b/basis/lists/lists-docs.factor index a3056b0332..bb47d31fcf 100644 --- a/basis/lists/lists-docs.factor +++ b/basis/lists/lists-docs.factor @@ -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." } ;