REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 3-Aug-2010 Edit History  

REBOL 3 Functions: append

append  series  value  /part  length  /only  /dup  count

Inserts a value at tail of series and returns the series at head. (Modifies)

Arguments:

series [series! port! map! gob! object! bitset!] - Series at point to insert

value [any-type!] - The value to insert

Refinements:

/part - Limits to a given length or position

length [number! series! pair!]

/only - Only insert a block as a single value (not the contents of the block)

/dup - Duplicates the insert a specified number of times

count [number! pair!]

See also:

insert   change   remove   repend  

Description

The append function is a shortcut for doing an insert at the tail of any type of series and returning the head:

head insert tail series value

Basic examples:

string: copy "hello"
probe append string " there"
"hello there"
file: copy %file
probe append file ".txt"
%file.txt
url: copy http://
probe append url "www.rebol.com"
http://www.rebol.com

The /only refinement forces a block to be appended as a single block element, rather than appending the separate elements of the block:

block: copy [1 2 3]
probe append block [4 5 6]
[1 2 3 4 5 6]
block: copy [1 2 3]
probe append/only block [4 5 6]
[1 2 3 [4 5 6]]

To learn more about the operation of the other refinements, see the insert function.


  TOC < Back Next > REBOL.com - WIP Wiki Feedback Admin