]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/circular/circular-docs.factor
factor: trim using lists
[factor.git] / basis / circular / circular-docs.factor
index 93d137d626d3b377a5a734652029d14a815264ae..259001ef0a75e05a5b7e9a096bf365c4933bb974 100644 (file)
@@ -1,7 +1,6 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: help.markup help.syntax io.streams.string sequences
-math kernel quotations ;
+USING: help.markup help.syntax sequences math kernel quotations ;
 IN: circular
 
 HELP: <circular-string>
@@ -55,6 +54,14 @@ HELP: circular-while
 }
 { $description "Calls " { $snippet "quot" } " on each element of the sequence until each call yields " { $link f } " in succession." } ;
 
+HELP: circular-loop
+{ $values
+    { "circular" circular }
+    { "quot" quotation }
+}
+{ $description "Calls " { $snippet "quot" } " on each element of the sequence until one call yields " { $link f } "." }
+{ $notes "This rotates the " { $link circular } " object after each call, so the next element to be applied will always be the first element." } ;
+
 ARTICLE: "circular" "Circular sequences"
 "The " { $vocab-link "circular" } " vocabulary implements the " { $link "sequence-protocol" } " to allow an arbitrary start index and wrap-around indexing." $nl
 "Creating a new circular object:"
@@ -74,6 +81,6 @@ ARTICLE: "circular" "Circular sequences"
     growing-circular-push
 }
 "Iterating over a circular until a stop condition:"
-{ $subsections circular-while } ;
+{ $subsections circular-while circular-loop } ;
 
 ABOUT: "circular"