Documentation Set for Swarm 2.2
Prev | Reference I. Defobj Library | Next

# Copy

## Name

Copy -- Copy all state defined as part of object.

## Description

An object type that supplies the copy operation defines what it includes as the contents of an object copied. There is no global rule for what is considered "inside" a copied object vs. merely referenced by it. (There is no fixed notion of "shallow" vs. "deep" copy found in some object libraries.) After copying, the new object may still contain some references to other elements also referenced by the starting object, but in general the new object minimizes any dependencies shared with the starting object. Any object type supplying the copy message should also supply documentation on its rules for copied objects.

## Protocols adopted by Copy

None

## Methods

### Phase: Using

- - copy: (id <Zone>)aZone
  The copy message creates a new object that has the same contents and resulting behavior as a starting object, except that an independent copy of the contents of the starting object is created so that further changes to one object do not affect the other. The zone argument specifies the source of storage for the new object. The message returns the id of the new object created.

Prev | Home | Next
CREATABLE | Up | Create