Introduction

Soup Entries Are Self-Contained

You can add any frame to a soup. When you add a frame to a soup, it becomes completely self-contained--nothing in the entry points outside the entry. To ensure that this is true, the OS takes any slots in the soup frame containing references (frames, arrays) and clones them.


Note:Consider the foolishness of adding a view frame to a soup. The view would be added. Next, the cloning follows the view's parent chain, merrily duplicating its parent and all its ancestors right up to and including the root view. Clearly, the store wouldn't be large enough to hold such an entry. An entry, then, is not just a frame, but everything the frame points to.


Further, this cloning occurs recursively to ensure that all references are properly copied. The most straightforward consequence of this is that you need to exercise care with what type of frame you add to a soup. You should also consider the converse situation: retrieving an entry means you are getting the entry's entire structure (including the cloned slots).


Note:The _proto slot of a frame receives special treatment. The _proto slot is stripped from a frame before adding it to a soup. The theory behind this is that the _proto slot points to ROM or pseudo-ROM, and therefore doesn't need to be saved in a soup.


An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.

Last modified: 1 DEC 1996