forked from rebol/rebol
-
Notifications
You must be signed in to change notification settings - Fork 2
Find all
angerangel edited this page Mar 19, 2013
·
1 revision
FIND-ALL 'series value body
Find all occurences of the value within the series (allows modification).
FIND-ALL is a function value.
- series -- Variable for block, string, or other series (word!)
- value
- body -- Evaluated for each occurence (block!)
#SOURCE
find-all: make function! [ [
{Find all occurences of the value within the series (allows modification).}
'series [word!] "Variable for block, string, or other series"
value
body [block!] "Evaluated for each occurence"
/local orig
][
assert [series? orig: get series]
while [any [set series find get series :value (set series orig false)] ] [
do body
++ (series)
]
] ]