]> gitweb.factorcode.org Git - factor.git/commitdiff
docs: fix lint errors.
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 6 Dec 2022 04:45:52 +0000 (22:45 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 26 Feb 2023 23:11:03 +0000 (17:11 -0600)
For some reason these $examples were not erroring but now they are.

basis/grouping/grouping-docs.factor
basis/help/cookbook/cookbook.factor
core/combinators/combinators-docs.factor
core/sequences/sequences-docs.factor
core/sequences/sequences.factor

index 4dedba2032b8be2d32dff868c1d42b59825e8ed1..3a1dc8e2ad33768c286a5d9963e7f65d1b65f6e5 100644 (file)
@@ -23,7 +23,7 @@ ARTICLE: "grouping" "Groups and clumps"
             "{ { 1 2 } { 3 4 } }"
         }
         { $example
-            "USING: grouping ;"
+            "USING: grouping prettyprint sequences ;"
             "{ 1 2 3 4 } dup"
             "2 <groups> concat sequence= ."
             "t"
@@ -31,12 +31,12 @@ ARTICLE: "grouping" "Groups and clumps"
     }
     { "With clumps, collecting the first element of each subsequence but the last one, together with the last subsequence, yields the original sequence:"
         { $example
-            "USING: grouping ;"
+            "USING: grouping prettyprint ;"
             "{ 1 2 3 4 } 2 clump ."
             "{ { 1 2 } { 2 3 } { 3 4 } }"
         }
         { $example
-            "USING: grouping assocs sequences ;"
+            "USING: grouping assocs sequences prettyprint ;"
             "{ 1 2 3 4 } dup"
             "2 <clumps> unclip-last [ keys ] dip append sequence= ."
             "t"
@@ -44,18 +44,18 @@ ARTICLE: "grouping" "Groups and clumps"
     }
     { "With circular clumps, collecting the first element of each subsequence yields the original sequence. Collecting the " { $snippet "n" } "th element of each subsequence would rotate the original sequence " { $snippet "n" } " elements rightward:"
         { $example
-            "USING: grouping ;"
+            "USING: grouping prettyprint ;"
             "{ 1 2 3 4 } 2 circular-clump ."
             "{ { 1 2 } { 2 3 } { 3 4 } { 4 1 } }"
         }
         { $example
-            "USING: grouping assocs sequences ;"
+            "USING: grouping assocs sequences prettyprint ;"
             "{ 1 2 3 4 } dup"
             "2 <circular-clumps> keys sequence= ."
             "t"
         }
         { $example
-            "USING: grouping ;"
+            "USING: grouping prettyprint ;"
             "{ 1 2 3 4 }"
             "2 <circular-clumps> [ second ] { } map-as ."
             "{ 2 3 4 1 }"
index e4b753a961e7203fe9051870e5eb1506cf505cc7..8f7850415397ceb5d71b21424f7f85af6e0cd581 100644 (file)
@@ -94,6 +94,7 @@ $nl
 $nl
 "You can perform an operation on each element of an array:"
 { $example
+    "USING: io sequences prettyprint ;"
     "{ 1 2 3 } [ \"The number is \" write . ] each"
     "The number is 1\nThe number is 2\nThe number is 3"
 }
index 38e90aa49447c2ccfbe33245a0f4af9bb05e13b0..404d31bb56cc37c49777bace18889388329cf48b 100644 (file)
@@ -89,6 +89,7 @@ ARTICLE: "compositional-examples" "Examples of compositional combinator usage"
 { $code ": subtract-n ( seq n -- seq' ) swap [ over - ] map nip ;" }
 "Three shuffle words are required to pass the value around. Instead, the loop-invariant value can be partially applied to a quotation using " { $link curry } ", yielding a new quotation that is passed to " { $link map } ":"
 { $example
+  "USING: sequences prettyprint ;"
   ": subtract-n ( seq n -- seq' ) [ - ] curry map ;"
   "{ 10 20 30 } 5 subtract-n ."
   "{ 5 15 25 }"
index 23273e5d7942f431544f10f9888a44685ad1ba37..feabe8c215b15c9901c16789378881be9131f5d4 100644 (file)
@@ -1432,7 +1432,7 @@ HELP: count-by
 { $examples
     { $example
         "USING: math ranges sequences prettyprint ;"
-        "100 [1..b] [ even? ] count ."
+        "100 [1..b] [ even? ] count-by ."
         "50"
     }
 } ;
index 4d5bc5219e77095ff603a1ba15a1dab95d796947..5822fcc5c2c4aec48c5cc70814a3f8576d151b8c 100644 (file)
@@ -209,7 +209,7 @@ PRIVATE>
 
 : ?nth-of ( seq n -- elt/f ) swap ?nth ; inline
 
-: ??nth-of ( seq n -- elt ? ) swap ??nth ; inline
+: ??nth-of ( seq n -- elt/f ? ) swap ??nth ; inline
 
 : index-or-length ( seq n -- seq n' ) over length min ; inline