 
 HELP: selector
 { $values
-     { "quot" { $quotation ( ... elt -- ... ? ) } }
-     { "selector" { $quotation ( ... elt -- ... ) } } { "accum" vector } }
+    { "quot" { $quotation ( ... elt -- ... ? ) } }
+    { "selector" { $quotation ( ... elt -- ... ) } } { "accum" vector } }
 { $description "Creates a new vector to accumulate the values which return true for a predicate. Returns a new quotation which accepts an object to be tested and stored in the collector if the test yields true. The collector is left on the stack for convenience." }
 { $examples
     { $example "! Find all the even numbers:" "USING: prettyprint sequences math kernel ;"


HELP: new-like
{ $values
     { "len" integer } { "exemplar" "an exemplar sequence" } { "quot" quotation }
     { "seq" sequence } }
{ $description "Creates a new sequence of length " { $snippet "len" } " and calls the quotation with this sequence on the stack. The output of the quotation and the original exemplar are then passed to " { $link like } " so that the output sequence is the exemplar's type." } ;

HELP: push-either
{ $values
     { "elt" object } { "quot" quotation } { "accum1" vector } { "accum2" vector } }
{ $description "Pushes the input object onto one of the accumulators; the first if the quotation yields true, the second if false." } ;

HELP: sequence-hashcode
{ $values
     { "n" integer } { "seq" sequence }
     { "x" integer } }
{ $description "Iterates over a sequence, computes a hashcode with " { $link hashcode* } " for each element, and combines them using " { $link sequence-hashcode-step } "." } ;

HELP: sequence-hashcode-step
{ $values
     { "oldhash" integer } { "newpart" integer }
     { "newhash" integer } }
{ $description "An implementation word that computes a running hashcode of a sequence using some bit-twiddling. The resulting hashcode is always a fixnum." } ;

HELP: index-or-length
{ $values
     { "seq" sequence } { "n" integer } { "n'" integer } }
{ $description "Returns the input sequence and its length or " { $snippet "n" } ", whichever is less." }
{ $examples { $example "USING: sequences kernel prettyprint ;"
    "\"abcd\" 3 index-or-length [ . ] bi@"


HELP: virtual-exemplar
{ $values
    { "seq" sequence }
    { "seq'" sequence } }
{ $description "Part of the virtual sequence protocol, this word is used to return an exemplar of the underlying storage. This is used in words like " { $link new-sequence } "." } ;

HELP: virtual@
{ $values
    { "n" integer } { "seq" sequence }
    { "n'" integer } { "seq'" sequence } }
{ $description "Part of the sequence protocol, this word translates the input index " { $snippet "n" } " into an index and the underlying storage this index points into." } ;

HELP: 2map-reduce
{ $values
    { "seq1" sequence } { "seq2" sequence } { "map-quot" { $quotation ( ..a elt1 elt2 -- ..a intermediate ) } } { "reduce-quot" { $quotation ( ..a prev intermediate -- ..a next ) } }
    { "result" object } }
 { $description "Calls " { $snippet "map-quot" } " on each pair of elements from " { $snippet "seq1" } " and " { $snippet "seq2" } " and combines the results using " { $snippet "reduce-quot" } " in the same manner as " { $link reduce } ", except that there is no identity element, and the sequence must have a length of at least 1." }
{ $errors "Throws an error if the sequence is empty." }
{ $examples { $example "USING: sequences prettyprint math ;"
