Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Rebol Programming/collect

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

USAGE: COLLECT body /into output DESCRIPTION: Evaluates a block, storing values via KEEP function, and returns block of collected values. COLLECT is a function value. ARGUMENTS body -- Block to evaluate (Type: block) REFINEMENTS /into -- Insert into a buffer instead (returns position after insert) output -- The buffer series (modified) (Type: series) SOURCE CODE collect: func [ {Evaluates a block, storing values via KEEP function, and returns block of collected values.} body [block!] "Block to evaluate" /into {Insert into a buffer instead (returns position after insert)} output [series!] "The buffer series (modified)" ][ unless output [output: make block! 16] do make function! [keep] copy/deep body make function! [value /only] copy/deep [ output: either only [insert/only output :value] [insert output :value] :value ] either into [output] [head output] ]