]> gitweb.factorcode.org Git - factor.git/commitdiff
Fixing eval unit test, and help lint failures from stricter help lint
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 27 Jan 2009 21:38:01 +0000 (15:38 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 27 Jan 2009 21:38:01 +0000 (15:38 -0600)
19 files changed:
basis/eval/eval-tests.factor
basis/formatting/formatting-docs.factor
basis/furnace/auth/auth-docs.factor
basis/furnace/syndication/syndication-docs.factor
basis/help/tutorial/tutorial.factor
basis/interval-maps/interval-maps-docs.factor
basis/io/encodings/8-bit/8-bit-docs.factor
basis/persistent/sequences/sequences-docs.factor
basis/sorting/human/human-docs.factor
basis/ui/tools/tools-docs.factor
basis/ui/ui-docs.factor
basis/unix/groups/groups-docs.factor
basis/unix/users/users-docs.factor
core/continuations/continuations-docs.factor
core/parser/parser-docs.factor
core/slots/slots-docs.factor
core/syntax/syntax-docs.factor
extra/partial-continuations/partial-continuations-docs.factor
extra/sequences/n-based/n-based-docs.factor

index db4b95acdc57b77a7057e52043e44566add47ebb..102a4d49efc187e1bc77add61abe5a15973af86b 100644 (file)
@@ -1,4 +1,4 @@
 IN: eval.tests
 USING: eval tools.test ;
 
-[ "4\n" ] [ "USING: math prettyprint ; 2 2 + ." eval>string ] unit-testv
\ No newline at end of file
+[ "4\n" ] [ "USING: math prettyprint ; 2 2 + ." eval>string ] unit-test
\ No newline at end of file
index 8db3567c23e2e75d08f4fd7564dbff3e3b639b57..196302f203a18d7a40055d37e15a66534a4d1558 100644 (file)
@@ -7,7 +7,7 @@ HELP: printf
 { $values { "format-string" string } }
 { $description 
     "Writes the arguments (specified on the stack) formatted according to the format string.\n" 
-    "\n"
+    $nl
     "Several format specifications exist for handling arguments of different types, and "
     "specifying attributes for the result string, including such things as maximum width, "
     "padding, and decimals.\n"
@@ -24,10 +24,10 @@ HELP: printf
         { "%+Px"    "Hexadecimal"                "hex" }
         { "%+PX"    "Hexadecimal uppercase"      "hex" }
     }
-    "\n"
+    $nl
     "A plus sign ('+') is used to optionally specify that the number should be "
     "formatted with a '+' preceeding it if positive.\n"
-    "\n"
+    $nl
     "Padding ('P') is used to optionally specify the minimum width of the result "
     "string, the padding character, and the alignment.  By default, the padding "
     "character defaults to a space and the alignment defaults to right-aligned. "
@@ -38,7 +38,7 @@ HELP: printf
         "\"%'#5f\" formats a float padding with '#' up to 3 characters wide."
         "\"%-10d\" formats an integer to 10 characters wide and left-aligns." 
     }
-    "\n"
+    $nl
     "Digits ('D') is used to optionally specify the maximum digits in the result "
     "string. For example:\n"
     { $list 
@@ -83,7 +83,7 @@ HELP: strftime
 { $values { "format-string" string } }
 { $description 
     "Writes the timestamp (specified on the stack) formatted according to the format string.\n"
-    "\n"
+    $nl
     "Different attributes of the timestamp can be retrieved using format specifications.\n"
     { $table
         { "%a"     "Abbreviated weekday name." }
@@ -118,7 +118,7 @@ HELP: strftime
 } ;
 
 ARTICLE: "formatting" "Formatted printing"
-"The " { $vocab-link "formatting" } " vocabulary is used for formatted printing.\n"
+"The " { $vocab-link "formatting" } " vocabulary is used for formatted printing."
 { $subsection printf }
 { $subsection sprintf }
 { $subsection strftime }
index 2ddd62687324ff4985cdaa8e8d4091de96a6cd2e..f1f68c975d7da81de04ff733a2ecd18e4b280f44 100644 (file)
@@ -121,7 +121,7 @@ $nl
 { $subsection "furnace.auth.providers.db" } ;
 
 ARTICLE: "furnace.auth.features" "Optional authentication features"
-"Vocabularies having names prefixed by " { $code "furnace.auth.features" } "  implement optional features which can be enabled by calling special words. These words define new actions on an authentication realm."
+"Vocabularies having names prefixed by " { $code "furnace.auth.features" } " implement optional features which can be enabled by calling special words. These words define new actions on an authentication realm."
 { $subsection "furnace.auth.features.deactivate-user" }
 { $subsection "furnace.auth.features.edit-profile" }
 { $subsection "furnace.auth.features.recover-password" }
index 94a69ccd0e31259d3c9ce76a656e4d2153364e53..1ce1cd7da1ac9c6b408b6fcafe97856fa3ae8359 100644 (file)
@@ -29,7 +29,7 @@ HELP: feed-entry-date
 HELP: feed-entry-description
 { $values
      { "object" object }
-     { "description" null }
+     { "description" string }
 }
 { $contract "Outputs a feed entry description." } ;
 
index 32cccee2578941c1bd5da59e34725d7cf49a0c56..efb1e0a0f75c0dfb93ef924488299e2fe0551e02 100644 (file)
@@ -30,7 +30,7 @@ ARTICLE: "first-program-logic" "Writing some logic in your first program"
     "! See http://factorcode.org/license.txt for BSD license."
     "IN: palindrome"
 }
-"We will now write our first word using " { $link POSTPONE: : } ". This word will test if a string is a palindrome; it will take a string as input, and give back a  boolean as output. We will call this word " { $snippet "palindrome?" } ", following a naming convention that words returning booleans have names ending with " { $snippet "?" } "."
+"We will now write our first word using " { $link POSTPONE: : } ". This word will test if a string is a palindrome; it will take a string as input, and give back a boolean as output. We will call this word " { $snippet "palindrome?" } ", following a naming convention that words returning booleans have names ending with " { $snippet "?" } "."
 $nl
 "Recall that a string is a palindrome if it is spelled the same forwards or backwards; that is, if the string is equal to its reverse. We can express this in Factor as follows:"
 { $code ": palindrome? ( string -- ? ) dup reverse = ;" }
index 1a862fbe2d9e61fb0f29eef1d326a7990da88417..de184585462f553fcf8ce2be277a8dcf751d3ab5 100644 (file)
@@ -18,7 +18,8 @@ HELP: <interval-map>
 { $description "From a specification, produce an interval tree. The specification is an assoc where the keys are intervals, or pairs of numbers to represent intervals, or individual numbers to represent singleton intervals. The values are the values int he interval map. Construction time is O(n log n)." } ;\r
 \r
 ARTICLE: "interval-maps" "Interval maps"\r
-"Interval maps are a mechanism, similar to assocs, where a set of closed intervals of keys are associated with values. As such, interval maps do not conform to the assoc protocol, because intervals of floats, for example, can be used, and it is impossible to get a list of keys in between."\r
+"The " { $vocab-link "interval-maps" } " vocabulary implements a data structure, similar to assocs, where a set of closed intervals of keys are associated with values. As such, interval maps do not conform to the assoc protocol, because intervals of floats, for example, can be used, and it is impossible to get a list of keys in between."\r
+$nl\r
 "The following operations are used to query interval maps:"\r
 { $subsection interval-at* }\r
 { $subsection interval-at }\r
index 8f5e955998ec929a3f8c0afd496da3df975b5a77..9ba4fcf44db598372a9b0d5e88922cee0fc4c304 100644 (file)
@@ -4,7 +4,7 @@ USING: help.syntax help.markup io.encodings.8-bit.private
 strings ;
 IN: io.encodings.8-bit
 
-ARTICLE: "io.encodings.8-bit" "8-bit encodings"
+ARTICLE: "io.encodings.8-bit" "Legacy 8-bit encodings"
 "Many encodings are a simple mapping of bytes onto characters. The " { $vocab-link "io.encodings.8-bit" } " vocabulary implements these generically using existing resource files. These encodings should be used with extreme caution, as fully general Unicode encodings like UTF-8 are nearly always more appropriate. The following 8-bit encodings are already defined:"
 { $subsection latin1 }
 { $subsection latin2 }
index 986b16c737d7f1a3e7324fb063a98a34b2953231..6928d03f5555a1ebc7de7f1e28819d41628b388b 100644 (file)
@@ -14,7 +14,7 @@ HELP: ppop
 { $contract "Persistent analogue of " { $link pop* } ". Outputs a new sequence with all elements of " { $snippet "seq" } " except for the final element." } ;
 
 ARTICLE: "persistent.sequences" "Persistent sequence protocol"
-"The persistent sequence protocol consists of the non-mutating sequence protocol words, such as  " { $link length } " and " { $link nth } ", together with the following operations:"
+"The persistent sequence protocol consists of the non-mutating sequence protocol words, such as " { $link length } " and " { $link nth } ", together with the following operations:"
 { $subsection new-nth }
 { $subsection ppush }
 { $subsection ppop }
index 5cd04c8090c0b759649534b6bf3ee2c428dcc12e..5952b3e3f9fb21d0c1edd205416d99c8aea83904 100644 (file)
@@ -55,7 +55,7 @@ HELP: human-sort-values
 
 { <=> >=< human-compare human-sort human-sort-keys human-sort-values } related-words
 
-ARTICLE: "sorting.human" "sorting.human"
+ARTICLE: "sorting.human" "Human-friendly sorting"
 "The " { $vocab-link "sorting.human" } " vocabulary sorts by numbers as a human would -- by comparing their magnitudes -- rather than in a lexicographic way. For example, sorting a1, a10, a03, a2 with human sort returns a1, a2, a03, a10, while sorting with natural sort returns a03, a1, a10, a2." $nl
 "Comparing two objects:"
 { $subsection human<=> }
index 8e1cc8d8f06b592e829a4428ec28dd525ab14bbc..2caea234801e0f05de7b010d02ac6566ca13c38a 100644 (file)
@@ -85,7 +85,7 @@ ARTICLE: "ui-completion-vocabs" "Vocabulary completion popup"
 { $operations "kernel" vocab } ;
 
 ARTICLE: "ui-completion-sources" "Source file completion popup"
-"The source file completion popup lists all source files which have been previously loaded by " { $link run-file } ". Clicking a source file  or pressing " { $snippet "RET" } " opens the source file in your editor with " { $link edit } "."
+"The source file completion popup lists all source files which have been previously loaded by " { $link run-file } ". Clicking a source file or pressing " { $snippet "RET" } " opens the source file in your editor with " { $link edit } "."
 { $operations P" " } ;
 
 ARTICLE: "ui-completion" "UI completion popups"
index 64a98fee0392bec439bb9b6b3207c3824fa0fd3f..5c0085bc45b40c13ed53037ced3d48375c38943b 100644 (file)
@@ -185,7 +185,9 @@ $nl
 { $subsection add-gadgets }
 { $subsection clear-gadget }
 "The children of a gadget are available via the "
-{ $snippet "children" } " slot. " "Working with gadget children:"
+{ $snippet "children" } " slot. "
+$nl
+"Working with gadget children:"
 { $subsection gadget-child }
 { $subsection nth-gadget }
 { $subsection each-child }
@@ -199,7 +201,7 @@ $nl
 { $subsection relayout-1 }
 "Gadgets implement a generic word to inform their parents of their preferred size:"
 { $subsection pref-dim* }
-"To get a gadget's preferred size, do not call the above word, instead use " { $link pref-dim  } ",  which caches the result." ;
+"To get a gadget's preferred size, do not call the above word, instead use " { $link pref-dim  } ", which caches the result." ;
 
 ARTICLE: "ui-null-layout" "Manual layouts"
 "When automatic layout is not appropriate, gadgets can be added to a parent with no layout policy, and then positioned and sized manually by setting the " { $snippet "loc" } " field." ;
index 07911bc96ba8a86e1a750ccdf8d1262143cef45f..05b22d341318badae48c51ef00ad20188ed53c74 100644 (file)
@@ -83,7 +83,6 @@ ARTICLE: "unix.groups" "Unix groups"
 $nl
 "Listing all groups:"
 { $subsection all-groups }
-"Returning a passwd tuple:"
 "Real groups:"
 { $subsection real-group-name }
 { $subsection real-group-id }
index 2d46ab2d817a3b7f94f5d1cc03bba55a7e073a9f..faee36d076027097d34b61e16ecb8477b0c17e59 100644 (file)
@@ -91,7 +91,6 @@ ARTICLE: "unix.users" "Unix users"
 $nl
 "Listing all users:"
 { $subsection all-users }
-"Returning a passwd tuple:"
 "Real user:"
 { $subsection real-user-name }
 { $subsection real-user-id }
index 3364f4465776a4d47e6317ac3060512ce98e9dd9..2cc44bee1bcc7ba83d31ab863db9cd444ad9926c 100644 (file)
@@ -1,6 +1,6 @@
 USING: help.markup help.syntax kernel kernel.private
 continuations.private vectors arrays namespaces
-assocs words quotations lexer sequences ;
+assocs words quotations lexer sequences math ;
 IN: continuations
 
 ARTICLE: "errors-restartable" "Restartable errors"
@@ -26,7 +26,7 @@ ARTICLE: "errors-anti-examples" "Common error handling pitfalls"
 $nl
 "In most other cases, " { $link cleanup } " should be used instead to handle an error and rethrow it automatically."
 { $heading "Anti-pattern #3: Dropping and rethrowing" }
-"Do not use " { $link recover } " to handle an error by dropping it and throwing a new error. By losing the original error message, you signal to the user that something failed without leaving any indication of what actually went wrong. Either wrap the error in a new error containing additional information, or rethrow the original error. A more subtle form of this is using  " { $link throw } " instead of " { $link rethrow } ". The " { $link throw } " word should only be used when throwing new errors, and never when rethrowing errors that have been caught."
+"Do not use " { $link recover } " to handle an error by dropping it and throwing a new error. By losing the original error message, you signal to the user that something failed without leaving any indication of what actually went wrong. Either wrap the error in a new error containing additional information, or rethrow the original error. A more subtle form of this is using " { $link throw } " instead of " { $link rethrow } ". The " { $link throw } " word should only be used when throwing new errors, and never when rethrowing errors that have been caught."
 { $heading "Anti-pattern #4: Logging and rethrowing" }
 "If you are going to rethrow an error, do not log a message. If you do so, the user will see two log messages for the same error, which will clutter logs without adding any useful information." ;
 
@@ -241,7 +241,7 @@ HELP: attempt-all
 
 HELP: retry
 { $values
-     { "quot" quotation } { "n" null }
+     { "quot" quotation } { "n" integer }
 }
 { $description "Tries the quotation up to " { $snippet "n" } " times until it returns true. Retries the quotation if an exception is thrown or if the quotation returns " { $link f } ". The quotation is expected to have side effects that may fail, such as generating a random name for a new file until successful." }
 { $examples
index 4da76468e81f74edc4f752eab72e196c2516a5ce..23bc41a1bb30f2b320d00be0877ee5760ca3938d 100644 (file)
@@ -41,7 +41,7 @@ ARTICLE: "defining-words" "Defining words"
 { $subsection parse-definition }
 "The " { $link POSTPONE: ; } " word is just a delimiter; an unpaired occurrence throws a parse error:"
 { $see POSTPONE: ; }
-"There are additional parsing words whose syntax is delimited by  " { $link POSTPONE: ; } ", and they are all implemented by calling " { $link parse-definition } "." ;
+"There are additional parsing words whose syntax is delimited by " { $link POSTPONE: ; } ", and they are all implemented by calling " { $link parse-definition } "." ;
 
 ARTICLE: "parsing-tokens" "Parsing raw tokens"
 "So far we have seen how to read individual tokens, or read a sequence of parsed objects until a delimiter. It is also possible to read raw tokens from the input and perform custom processing."
index c9ce33438809c225c0c280e58d1c9495ed6f6a35..bdc5a5ba07adebfd917f4b0b4204376e277a5e86 100644 (file)
@@ -84,10 +84,9 @@ $nl
 { $subsection initial-value } ;
 
 ARTICLE: "slots" "Slots"
-"A " { $emphasis "slot" } " is a component of an object which can store a value."
+"The " { $vocab-link "slots" } " vocabulary contains words for introspecting the slots of an object. A " { $emphasis "slot" } " is a component of an object which can store a value."
 $nl
 { $link "tuples" } " are composed entirely of slots, and instances of " { $link "builtin-classes" } " consist of slots together with intrinsic data."
-"The " { $vocab-link "slots" } " vocabulary contains words for introspecting the slots of an object."
 $nl
 "The " { $snippet "\"slots\"" } " word property of built-in and tuple classes holds an array of " { $emphasis "slot specifiers" } " describing the slot layout of each instance."
 { $subsection slot-spec }
index d8cd56ff3d2d82ea6ea3f9f9201297f4f86bea6f..c99c226a0c3da776df72c12d60b631a2c6f9c19e 100644 (file)
@@ -5,7 +5,7 @@ assocs words.symbol words.alias words.constant ;
 IN: syntax
 
 ARTICLE: "parser-algorithm" "Parser algorithm"
-"At the most abstract level, Factor syntax consists of whitespace-separated tokens. The parser tokenizes the input on whitespace boundaries.  The parser is case-sensitive and whitespace between tokens is significant, so the following three expressions tokenize differently:"
+"At the most abstract level, Factor syntax consists of whitespace-separated tokens. The parser tokenizes the input on whitespace boundaries. The parser is case-sensitive and whitespace between tokens is significant, so the following three expressions tokenize differently:"
 { $code "2X+\n2 X +\n2 x +" }
 "As the parser reads tokens it makes a distinction between numbers, ordinary words, and parsing words. Tokens are appended to the parse tree, the top level of which is a quotation returned by the original parser invocation. Nested levels of the parse tree are created by parsing words."
 $nl
index a70109347bdbc6295e76ff3b884d5d75556f71f8..ef155651725d19ef60ab52c098d34d3bc502ee70 100644 (file)
@@ -12,9 +12,9 @@ HELP: bshift
 { $notes "It is important to note that even if the quotation discards items on the stack, the stack will be restored to the way it was before it is called (which is true of continuation usage in general)." } ;
 
 ARTICLE: "partial-continuations" "Partial continuations"
-"Based on Scheme code for bshift and breset from"
+"Based on Scheme code for bshift and breset from "
 { $url "http://groups.google.com/group/comp.lang.scheme/msg/9f0d61da01540816" } "."
-"See this blog entry for more details:"
+" See this blog entry for more details:"
 { $url "http://www.bluishcoder.co.nz/2006/03/factor-partial-continuation-updates.html" }
 { $subsection breset }
 { $subsection bshift } ;
index ca5ac57cec367bf2bd46366eb1e3f3ddf015a0d9..6c56300f6df0fa71accbb07902b96c4e53240c9d 100644 (file)
@@ -57,7 +57,7 @@ IN: scratchpad
 
 { n-based-assoc <n-based-assoc> } related-words
 
-ARTICLE: "sequences.n-based" "sequences.n-based"
+ARTICLE: "sequences.n-based" "N-based sequences"
 "The " { $vocab-link "sequences.n-based" } " vocabulary provides a sequence adaptor that allows a sequence to be treated as an assoc with non-zero-based keys."
 { $subsection n-based-assoc }
 { $subsection <n-based-assoc> }