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

copy

copy( 
l_arg 
) 
=> l_result

Description

Returns a copy of a list, that is, a list with all the top-level cells duplicated.

Because list structures in SKILL are typically shared, it is necessary to pass around pointers to lists. If, however, any function that modifies a list destructively is used, copy is often used to create new copies of a list so that the original is not inadvertently modified by those functions. This call is costly so its use should be limited. This function only duplicates the top-level list cells, all lower level objects are still shared.

Arguments

l_arg

List of elements.

Value Returned

l_result

A copy of l_arg.

Examples

z = '(1 (2 3) 4) 
=> (1 (2 3) 4)

x = copy(z)      
=> (1 (2 3) 4)

z and x have the same value.

equal(z x)       
=> t

z and x are not the same list.

eq(z x)         
=> nil

Related Topics

car

cdr

append

append1


Return to top
 ⠀
X