Replaces those elements of mutable-collection for which predicate returns true. The elements are replaced with the value of calling new-value-fn on the existing element. If count is #f, all of the matching elements are replaced. Otherwise, no more than count elements are replaced.
mutable-collection may be modified by this operation.
define variable numbers = list (10, 13, 16, 19)
replace-elements! (numbers, odd?, double)
⇒ #(10, 26, 16, 38)
open
| mutable-collection | An instance of <mutable-collection>. |
| predicate | An instance of <function>. |
| new-value-fn | An instance of <function>. |
| count: | An instance of <integer> or #f. The default is #f. |
| mutable-collection | An instance of <mutable-collection>. |