From 12ae1006a43cb65382ebf61ca8e00d7df2e67f38 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 5 Dec 2022 22:45:52 -0600 Subject: [PATCH] docs: fix lint errors. For some reason these $examples were not erroring but now they are. --- basis/grouping/grouping-docs.factor | 12 ++++++------ basis/help/cookbook/cookbook.factor | 1 + core/combinators/combinators-docs.factor | 1 + core/sequences/sequences-docs.factor | 2 +- core/sequences/sequences.factor | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/basis/grouping/grouping-docs.factor b/basis/grouping/grouping-docs.factor index 4dedba2032..3a1dc8e2ad 100644 --- a/basis/grouping/grouping-docs.factor +++ b/basis/grouping/grouping-docs.factor @@ -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 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 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 keys sequence= ." "t" } { $example - "USING: grouping ;" + "USING: grouping prettyprint ;" "{ 1 2 3 4 }" "2 [ second ] { } map-as ." "{ 2 3 4 1 }" diff --git a/basis/help/cookbook/cookbook.factor b/basis/help/cookbook/cookbook.factor index e4b753a961..8f78504153 100644 --- a/basis/help/cookbook/cookbook.factor +++ b/basis/help/cookbook/cookbook.factor @@ -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" } diff --git a/core/combinators/combinators-docs.factor b/core/combinators/combinators-docs.factor index 38e90aa494..404d31bb56 100644 --- a/core/combinators/combinators-docs.factor +++ b/core/combinators/combinators-docs.factor @@ -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 }" diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index 23273e5d79..feabe8c215 100644 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@ -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" } } ; diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index 4d5bc5219e..5822fcc5c2 100644 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -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 -- 2.34.1