 HELP: map-sum
 { $values { "seq" sequence } { "quot" quotation } { "n" number } }
 { $description "Like map sum, but without creating an intermediate sequence." }
-{ $example
-    "USING: math math.ranges sequences prettyprint ;"
-    "100 [1,b] [ sq ] map-sum ."
-    "338350"
+{ $examples
+    { $example
+        "USING: math math.ranges sequences prettyprint ;"
+        "100 [1,b] [ sq ] map-sum ."
+        "338350"
+    }
 } ;
 
 HELP: count
 { $values { "seq" sequence } { "quot" quotation } { "n" integer } }
 { $description "Efficiently returns the number of elements that the predicate quotation matches." }
-{ $example
-    "USING: math math.ranges sequences prettyprint ;"
-    "100 [1,b] [ even? ] count ."
-    "50"
+{ $examples
+    { $example
+        "USING: math math.ranges sequences prettyprint ;"
+        "100 [1,b] [ even? ] count ."
+        "50"
+    }
 } ;
 
 HELP: selector

     { "seq" sequence } { "quot" quotation }
     { "slice" slice } }
{ $description "Removes elements starting from the left side of a sequence if they match a predicate. Once an element does not match, the test stops and the rest of the sequence is left on the stack as a slice" }
{ $example "USING: prettyprint math sequences ;"
           "{ 0 0 1 2 3 0 0 } [ zero? ] trim-head-slice ."
           "T{ slice { from 2 } { to 7 } { seq { 0 0 1 2 3 0 0 } } }"
} ;

HELP: trim-tail

     { "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 ;"
               "10 iota [ even? ] selector [ each ] dip ."
               "V{ 0 2 4 6 8 }"
    }
}
{ $notes "Used to implement the " { $link filter } " word. Compare this word with " { $link collector } ", which is an unfiltering version." } ;

