跳转到内容

Rebol 编程/remove-each

来自维基教科书,开放的书籍,开放的世界
REMOVE-EACH 'word data body 

从一个序列中移除一个值,针对每个返回TRUE的块。

REMOVE-EACH 是一个原生值。

  • word -- 每次设置的词语或词语块(将是局部的)(类型: get-word word block)
  • data -- 要遍历的序列(类型: series)
  • body -- 要执行的块。返回TRUE以移除。(类型: block)

源代码

[编辑 | 编辑源代码]
remove-each: native[
    {Removes a value from a series for each block that returns TRUE.} 
    'word [get-word! word! block!] {Word or block of words to set each time (will be local)} 
    data [series!] "The series to traverse" 
    body [block!] "Block to evaluate. Return TRUE to remove."
]
华夏公益教科书