]> gitweb.factorcode.org Git - factor.git/commitdiff
Documentation fixes
authorslava <slava@factorcode.org>
Wed, 13 Dec 2006 08:13:30 +0000 (08:13 +0000)
committerslava <slava@factorcode.org>
Wed, 13 Dec 2006 08:13:30 +0000 (08:13 +0000)
core/collections/sequence-combinators.facts
core/collections/sequences-epilogue.facts
core/collections/vectors.facts
core/compiler/alien/syntax.facts
core/generic/tuple.factor
core/help/markup.facts
core/kernel.facts
core/quotations.facts
core/syntax/parse-syntax.facts
core/ui/gadgets/outliner.facts

index b7827c6c150b33712e265339c2e7d0a19cbf288e..82f7ffdc7d6a632ff9961690cf62f391af62820c 100644 (file)
@@ -24,7 +24,7 @@ HELP: accumulate
 { $values { "seq" "a sequence" } { "quot" "a quotation with stack effect " { $snippet "( prev elt -- next )" } } { "final" "the final result" } { "newseq" "a new sequence" } }
 { $description "Combines successive elements of the sequence using a binary operation, and outputs a sequence of intermediate results together with the final result. On the first iteration, the two inputs to the quotation are " { $snippet "identity" } ", and the first element of the sequence. On successive iterations, the first input is the result of the previous iteration, and the second input is the corresponding element of the sequence. Given the empty sequence, outputs a one-element sequence consisting of " { $snippet "identity" } "." }
 { $examples
-    { $example "{ 2 2 2 2 2 } 0 [ + ] accumulate . ." "{ 0 2 4 6 8 } 10" }
+    { $example "{ 2 2 2 2 2 } 0 [ + ] accumulate . ." "{ 0 2 4 6 8 }\n10" }
 } ;
 
 HELP: map
@@ -163,9 +163,9 @@ HELP: monotonic?
 { $description "Applies the relation to successive pairs of elements in the sequence, testing for a truth value. The relation should be a transitive relation, such as a total order or an equality relation." }
 { $examples
     "Testing if a sequence is non-decreasing:"
-    { $example "{ 1 1 2 } [ >= ] monotonic?" "t" }
+    { $example "{ 1 1 2 } [ >= ] monotonic? ." "t" }
     "Testing if a sequence is decreasing:"
-    { $example "{ 9 8 6 7 } [ < ] monotonic?" "f" }
+    { $example "{ 9 8 6 7 } [ < ] monotonic? ." "f" }
 }
 { $see-also all-eq? all-equal? } ;
 
index 752c496e7749fe516461767f3385863241d54f30..4c4f4021fedc27a9469adbf6e1c1eedebd3bc062 100644 (file)
@@ -78,7 +78,7 @@ HELP: push-new
         "\"nachos\" \"v\" get push-new"
         "\"salsa\" \"v\" get push-new"
         "\"v\" get ."
-        "V{ \"beans\" \"cheese\" \"salsa\" \"nachos\" }"
+        "V{ \"beans\" \"cheese\" \"nachos\" \"salsa\" }"
     }
 }
 { $side-effects "seq" }
@@ -222,7 +222,7 @@ HELP: cond
 }
 { $errors "Throws a " { $link no-cond } " error if none of the test quotations yield a true value." }
 { $examples
-    { $example
+    { $code
         "{"
         "    { [ dup 0 > ] [ \"positive\" ] }"
         "    { [ dup 0 < ] [ \"negative\" ] }"
index d356cbd0df98ce1a17ca8dfff7282fcb6f7689e3..b021e0bf5418ebf7b87fa474c6f799d7ed1ee4f4 100644 (file)
@@ -18,5 +18,5 @@ HELP: with-datastack
 { $values { "stack" "a sequence" } { "word" "a word" } { "newstack" "a sequence" } }
 { $description "Executes " { $snippet "word" } " with the given data stack contents, and outputs the new data stack after the word returns. Does not affect the data stack in surrounding code, other than consuming the two inputs and pushing the output." }
 { $examples
-    { $example "{ 3 7 } \ + with-datastack ." "V{ 10 }" }
+    { $example "{ 3 7 } \\ + with-datastack ." "V{ 10 }" }
 } ;
index 9ad218306771fd1620f27a50625f04522fad854d..d731a420da64591f02bfab91ec71f75af9eecdd4 100644 (file)
@@ -34,7 +34,7 @@ $terpri
 }
 "You can define a word for invoking it:"
 { $example
-    "LIBRARY: foo\nFUNCTION: the_answer ( char* question, int value ) ;\n\ the_answer compile\n\"the question\" 42 the-answer" "The answer to the question is 42."
+    "LIBRARY: foo\nFUNCTION: void the_answer ( char* question, int value ) ;\n\\ the_answer compile\n\"the question\" 42 the-answer" "The answer to the question is 42."
 } }
 { $notes "Note that the parentheses and commas are only syntax sugar and can be omitted; they serve no purpose other than to make the declaration slightly easier to read:"
 { $code
index 545f6facb610fabe73e512f22cbc33a30f03ddcd..63027e43de631ae0c6a1e0de57d468f3c7ea5e02 100644 (file)
@@ -52,7 +52,7 @@ IN: generic
     2dup delegate-slots swap append "slots" set-word-prop
     define-slots ;
 
-PREDICATE: class tuple-class tuple-size ;
+PREDICATE: class tuple-class tuple-size >boolean ;
 
 TUPLE: check-tuple class ;
 : check-tuple ( class -- class )
index 37de2174b88c50e55e5b227b67392a4ec4cb6297..53fd43da4d27713dacdcac21ffc7cd9f1c0739de 100644 (file)
@@ -99,7 +99,7 @@ HELP: textual-list
 { $values { "seq" "a sequence" } { "quot" "a quotation with stack effect " { $snippet "( elt -- )" } } }
 { $description "Applies the quotation to each element of the sequence, printing a comma between each pair of elements." }
 { $examples
-    { $example "{ \"fish\" \"chips\" \"salt\" } [ write ] textual-list print" "fish, chips, salt" }
+    { $example "{ \"fish\" \"chips\" \"salt\" } [ write ] textual-list" "fish, chips, salt" }
 } ;
 
 HELP: $links
index 38bfb375cf16e6f9ceff351a2e58ecdc4a06d443..8a82cc7d347f659dd22a89d3987a1d56708ca536 100644 (file)
@@ -317,10 +317,10 @@ HELP: declare
 { $description "Declares that the elements at the top of the stack are instances of the classes in " { $snippet "spec" } "." }
 { $warning "The compiler blindly trusts declarations, and false declarations can lead to crashes, memory corruption and other undesirable behavior." }
 { $examples
-    "The optimizer cannot do anything with the below quotation:"
-    { $example "[ 2 + 10 * ] f dataflow." "[ 2 + 10 * ]" }
+    "The optimizer cannot do anything with the below code as you can verify with " { $link "ui-dataflow" } ":"
+    { $code "2 + 10 *" }
     "However, if we declare that the top of the stack is a " { $link float } ", then type checks and generic dispatch are eliminated, and the compiler can use unsafe intrinsics:"
-    { $example "[ { float } declare 2 + 10 * ] f dataflow." "[ 2.0 float+ 10.0 float* ]" }
+    { $code "{ float } declare 2 + 10 *" }
 } ;
 
 HELP: array-capacity
index 98ee351df6a04fee7b59a5d32d28f08630a9a523..07f5df1c0570b96526cb13199e0be282ca3606d4 100644 (file)
@@ -43,7 +43,7 @@ HELP: literalize
 { $description "Outputs an object which evaluates to " { $snippet "obj" } " when placed in a quotation. If " { $snippet "obj" } " is not self-evaluating (for example, it is a word), then it will be wrapped." }
 { $examples
     { $example "5 literalize ." "5" }
-    { $example "[ + ] [ litealize ] map ." "[ \\ + ]" }
+    { $example "[ + ] [ literalize ] map ." "[ \\ + ]" }
 }
 { $see-also curry <wrapper> } ;
 
index bf4a385e260476de83add452bce3aa6583af75cd..4ed9e276877e040ee5191b9839d63d84c6bd4355 100644 (file)
@@ -160,7 +160,7 @@ HELP: "
 { $syntax "\"string...\"" }
 { $values { "string" "literal and escaped characters" } }
 { $description "Reads from the input string until the next occurrence of " { $link POSTPONE: " } ", and appends the resulting string to the parse tree. String literals cannot span multiple lines. Strings containing the " { $link POSTPONE: " } " character and various other special characters can be read by inserting escape sequences." }
-{ $examples { $example "\"Hello\nworld\" print" "Hello\nworld" } } ;
+{ $examples { $example "\"Hello\\nworld\" print" "Hello\nworld" } } ;
 
 HELP: SBUF"
 { $syntax "SBUF\" string... \"" }
index f1c029249ac8b6b641d2cbcadff97b9bfd44a20a..498de3cd6f657775154af858fdb801468f3fc65c 100644 (file)
@@ -1,10 +1,10 @@
 IN: gadgets-outliners
 USING: help gadgets gadgets-buttons kernel ;
 
-TUPLE: guide
+HELP: guide
 { $class-description "A class implementing the " { $link draw-interior } " generic word to draw a single vertical line." } ;
 
-TUPLE: outliner
+HELP: outliner
 { $class-description "A gadget with an expander arrow which can be clicked to show and hide a child gadget generated by the quotation stored in the " { $link outliner-quot } " slot. Outliners are created by calling " { $link <outliner> } "." }
 { $see-also <outliner> "presentations" } ;