Skip to content
angerangel edited this page Mar 19, 2013 · 1 revision

USAGE

   FIND-ALL 'series value body

DESCRIPTION

Find all occurences of the value within the series (allows modification).

FIND-ALL is a function value.

ARGUMENTS

  • 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)
    ]
] ]
Clone this wiki locally