Find all

angerangel edited this page Jan 3, 2013 · 1 revision

USAGE

   FIND-ALL 'series value body

DESCRIPTION

Find all occurances 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 occurance (block!)

#SOURCE

find-all: make function! [  [
    {Find all occurances of the value within the series (allows modification).}
    'series [word!] "Variable for block, string, or other series"
    value
    body [block!] "Evaluated for each occurance"
    /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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.