next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Macaulay2Doc > The Macaulay2 language > hash tables > copy

copy -- copy an object


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

For the programmer

The object copy is a compiled function.