REBOL Programming/forall

USAGE:Edit

FORALL 'word body 

DESCRIPTION:Edit

Evaluates a block for every value in a series.

FORALL is a function value.

ARGUMENTSEdit

  • word -- Word set to each position in series and changed as a result (Type: word)
  • body -- Block to evaluate each time (Type: block)

(SPECIAL ATTRIBUTES)Edit

  • catch
  • throw

SOURCE CODEEdit

forall: func [
    "Evaluates a block for every value in a series." 
    [catch throw] 
    'word [word!] {Word set to each position in series and changed as a result} 
    body [block!] "Block to evaluate each time"
][
    throw-on-error [forskip :word 1 body]
]
Last modified on 27 October 2012, at 22:08