}
{ $description "Calls " { $snippet "quot" } " on each element of the sequence until each call yields " { $link f } " in succession." } ;
+HELP: circular-while*
+{ $values
+ { "circular" circular }
+ { "quot" quotation }
+}
+{ $description "Calls " { $snippet "quot" } " on each element of the sequence until one call yields " { $link f } "." } ;
+
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:"
growing-circular-push
}
"Iterating over a circular until a stop condition:"
-{ $subsections circular-while } ;
+{ $subsections circular-while circular-while* } ;
ABOUT: "circular"
: circular-while ( ... circular quot: ( ... obj -- ... ? ) -- ... )
[ clone ] dip [ <circular-iterator> ] dip (circular-while) ; inline
+
+: circular-while* ( ... circular quot: ( ... obj -- ... ? ) -- ... )
+ [ clone ] dip '[ [ first @ ] [ rotate-circular ] bi ] curry loop ; inline