Rebol 编程/alter
外观
< Rebol 编程
ALTER series value /case
如果在序列中找不到值,则将其追加;否则,将其删除。如果添加了则返回 true。(修改)
ALTER 是一个函数值。
- series -- (类型:序列端口)
- value -- (类型:任何)
- /case -- 区分大小写的比较
alter: func [ {If a value is not found in a series, append it; otherwise, remove it. Returns true if added. (Modifies)} series [series! port!] value /case "Case-sensitive comparison" ][ found? unless remove ( either case [find/case series :value] [find series :value] ) [append series :value] ]