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
Value Returned
Examples
z = '(1 (2 3) 4)
=> (1 (2 3) 4)
x = copy(z)
=> (1 (2 3) 4)
equal(z x)
=> t
z and x are not the same list.
eq(z x)
=> nil
Related Topics
Return to top