Inter-Office Memorandum
To  Interpress Interest Date September 7, 1983
From Doug Wyatt  Location Palo Alto
Subject Implementing Interpress Organization PARC/ISL
Filed on: [Indigo]<Interpress>IPImpl.Tioga and IPImpl.Interpress
Uses: [Indigo]<Interpress>Styles>Interpress.Style and Cedar.Style
Implementing Interpress
Introduction
Introduction goes here.
If you are looking at this document on-line, you might want to use the level-clipping function to see the overall structure rather than simply plowing straight through. Hit the "Levels" button in the top menu, then hit "FirstLevelOnly" in the new menu that appears. That will show you the major section headings. Hit "MoreLevels" to see the subsections, or hit "AllLevels" to read the details.
Cedar vs. Mesa
Type representation
Types Any, Mark, Body, other stuff (Block, Page).
Storage management
Worry about multiple instances?
Encodings
Scanning
In general, every byte of the master must be read twice: once while parsing the skeleton, and again while actually interpreting the master. Can save some work if the master is being scanned only for structure: can ignore sequence data, for instance.
The skeleton
Handling {} and []
The base language
State
Allow for multiple instances of the interpreter running in parallel. Example: several windows displaying Interpress documents.
The stack
Linked list or array? Impact on the implementation of ROLL. Use cache for a small number of Integers on top of the stack.
Frames and Contexts
Note that frames must be copied; one might be tempted to use the pool mechanism to restore values overwritten by FSET, but this will not suffice. For example, consider an Operator that calls itself recursively.
One useful optimization for frames: don't copy until the first FSET.
Errors
Carefully define what happens when an UNMARK0 causes an error.
The imager
Imager variables
Saving and restoring persistent and non-persistent variables. Is the mechanism general enough for arbitrary Pools? What's special about the Transformation T? What should be cached?
Sampled masks and the cache
Clipper must note whether a sampled mask has been clipped.
Priority
Handling IFCOPY
How does IFCOPY interact with priorityImportant?
PD files
The printing engine
Performance
Tests
Try exceeding various limits: maxInteger, stack size, id length, ...
sequenceContinued in any sequence
numeric sequences with unusual lengths
rational with zero denominator
Vector other than sequenceString for string
Vector other than sequenceLargeVector & friends for large vector
Vector other than result of FINDFONT or MODIFYFONT for showVec
apply GET to result of MERGEPROP
apply GETPROP to Vector other than result of MERGEPROP
apply GET or GETPROP to sequenceString, sequenceLargeVector, etc.