1.4 Pict Findable and Replaceable Identity
Every predefined pict constructor or update method creates a pict that has a fresh identity for the purpose of to find or replace a pict p within another pict q when q is constructed from p (as introduced in Static Picts). The == operation on picts does not compare picts by this identity. Use Pict.identity to extract a pict’s identity as used for finding it in another pict. The findable children of a pict, as reported by the Pict.children property, are the immediate picts of q that were used to construct it, and recurring through Pict.children properties from q reaches all findable picts used to construct q.
Sometimes, it’s useful to suppress the identity of a pict and all of the picts used to build that one. The Pict.launder operation on a pict produces one that draws the same and has the same bounding box, but has a fresh identity and that hides the identity of all picts used to construct it, so Find and similar functions cannot find them. The Pict.children property of the result of Pict.launder is an empty list.
Like a pict’s width and height, it’s findable location within another pict is technically a property of a static pict. A snapshot (via Pict.snapshot) of a pict by default has an identity that is the same as the original pict. Consequently, it is possible and convenient to find the location of (a snapshot of) an animated pict within the snapshot of another animated pict. In the same way that Pict.width on an animated pict produces a result matching a snapshot of the pict at the start of its time box, finding an animated pict within another animated more precisely returns the location of a snapshot within a snapshot.
Not all findable children of a pict are necessarily findable in every snapshot of the pict. The findable children of a pict constructed with switch includes all of the arguments to switch, and Find.start_in can find the epoch when a pict (possibly a descendant of an argument to switch) starts within the animation sequence. Taking a snapshot of a switch pict produces a pict with time-specific children, all of which can be found in the snapshot. Unlike switch, the result of animate can only report snapshot-specific findable children, because getting children of the animation implicitly takes a snapshot.
Potentially distinct from the findable children of a pict are its replaceable dependencies, which are picts that can be discovered and replaced with Pict.rebuild or Pict.replace. Normally, the findable children and replaceable dependencies of a pict are the same, both determined by the pict’s construction. The rebuildable function creates a pict with only the listed dependencies, however, while the result of a rebuild function supplied to rebuildable determines its findable children. Similarly, animate creates an animated pict p with declared dependencies. In general, the findable children of a pict, such as one from rebuildable or animate, can vary over time or configuration, but its replaceable dependencies stay the same.
Similar to the way that Pict.snapshot produces a pict with the same findable and replaceable identity as the snapshotted pict, a rebuilt pict via Pict.rebuild gets an identity matching the original pict. This rule also allows the rebuilt version of some pict p to be found within a rebuilt version of q in the case that a dependency of p is updated to produce the rebuilt q. Also, in that case, the Pict.find_rebuilt method of the rebuilt q finds and returns the rebuilt pict that replaced p.