Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

append

append( 
l_list1 
l_list2 
) 
=> l_result 

append( 
o_table 
g_assoc 
) 
=> o_table  

append( 
o_table1 
o_table2 
) 
=> o_newTable 

Description

Creates a list containing the elements of l_list1 followed by the elements of l_list2 or returns the original association table including new entries.

The top-level list cells of l_list1 are duplicated and the cdr of the last duplicated list cell is set to point to l_list2; therefore, this is a time-consuming operation if l_list1 is a long list.

This is a slow operation and the functions tconc, lconc, and nconc can be used instead for adding an element or a list to the end of a list. The command cons is even better if the new list elements can be added to the beginning of the list.

The append function can also be used with association tables as shown in the second syntax statement. Key/value pairs are added to the original association table (not to a copy of the table). This function should be used mainly in converting existing association lists or disembodied property lists to an association table.

Arguments

l_list1

List of elements to be added to a list.

l_list2

List of elements to be added.

o_table

Association table to be updated.

g_assoc

Key/value pairs to be added to the association table.

Value Returned

l_result

A list containing elements of l_list1 followed by elements of l_list2.

o_table

The original association table including the new entries.

Examples

/* List Example */
append( '(1 2) '(3 4) )
=> (1 2 3 4)
/* Association Table Example */
myTable = makeTable("myAssocTable")
=> table:myAssocTable
myTable['a] = 1
=> 1
append(myTable '((b 2) (c 3)))
=> table:myAssocTable
/* Check the contents of the assoc table */
tableToList(myTable)
=> ((a 1) (b 2) (c 3))

Related Topics

tconc

lconc

nconc

append1

cons

Association Table


Return to top
 ⠀
X