Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » hash tables » copy
next | previous | forward | backward | up | index | toc

# copy -- copy an object

## Description

copy x yields a copy of x.

If x is an hash table, array, list or sequence, then the elements are placed into a new copy. If x is a hash table, the copy is mutable if and only if x is.

It is not advisable to copy such things as modules and rings, for: (1) the operations that have already been installed for them will return values in the original object, rather than in the copy; and (2) the copy operation is shallow, not copying keys and values that happen to be hash tables.

## See also

- newClass -- set the class and parent of an object

## For the programmer

The object copy is a compiled function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/ov_hashtables.m2:340:0.