跳轉到內容

Rebol 程式設計/append

來自華夏公益教科書,開放的書籍,為開放的世界
APPEND series value /only 

將值追加到序列尾部並返回序列頭。

APPEND 是一個函式值。

  • series -- (型別:序列埠)
  • value -- (型別:任何)
  • /only -- 將塊值追加為塊

原始碼

[編輯 | 編輯原始碼]
append: func [
    {Appends a value to the tail of a series and returns the series head.} 
    series [series! port!] 
    value 
    /only "Appends a block value as a block"
][
    head either only [
        insert/only tail series :value
    ] [
        insert tail series :value
    ]
]
華夏公益教科書